Big update from Mark Bradley:
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 20 Oct 2003 16:34:09 +0000 (16:34 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 20 Oct 2003 16:34:09 +0000 (16:34 +0000)
Finish tracks.  Add routes to Mapsource.
Add psitrex.

gpsbabel/Makefile
gpsbabel/README
gpsbabel/defs.h
gpsbabel/garmin_tables.h
gpsbabel/mapsource.c
gpsbabel/mingw/mkwintesto.c
gpsbabel/reference/psitwpts.txt [new file with mode: 0755]
gpsbabel/reference/route/psitrtes.txt [new file with mode: 0755]
gpsbabel/reference/track/psittrks.txt [new file with mode: 0755]
gpsbabel/testo
gpsbabel/vecs.c

index 138ef65a5d520041466f34c0e7923b37de2f1010..35abf74e15ccbd635fe9f8889eb8558fdcdf910b 100644 (file)
@@ -18,7 +18,7 @@ FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o \
        gpsutil.o pcx.o cetus.o copilot.o gpspilot.o magnav.o \
        psp.o holux.o garmin.o tmpro.o tpg.o \
        xcsv.o gcdb.o tiger.o internal_styles.o easygps.o quovadis.o \
-       gpilots.o saroute.o navicache.o
+       gpilots.o saroute.o navicache.o psitrex.o
 
 FILTERS=position.o duplicate.o arcdist.o polygon.o
 
index 86b625116b5fe766d30daed875ee27ffe9af286f..097eb4d4ae64030172f13aef714819535bf91869 100644 (file)
@@ -145,24 +145,27 @@ THE FORMATS
 
     MAPSOURCE
 
-        Garmin Mapsource format appears compatible with the various
-        members of that product family.  Icon mapping is oriented toward
-        versions above 4.07.  Altitude is supported, but proximity, and 
-       depth are not.   Naming files *.mps will allow file->open in 
+       Garmin Mapsource format appears compatible with the various
+       members of that product family.  Icon mapping is attempted between
+       different MapSource versions.  Altitude is supported, but proximity 
+       and depth are not.   Naming files *.mps will allow file->open in 
        Mapsource to find the files more easily.   Versions 3, 4 and 5 
        of the Mapsource data format are handled automatically on input 
        and by default the output is version 3 for maximum compatibility.  
-       Waypoints and tracklogs are handled, but routes are "work in 
-       progress" - maps are ignored.
+       Waypoints, routes and tracklogs are all handled, but maps sets are 
+       ignored.
 
-        Information on the Garmin Mapsource format was provided by Ian
-        Cowley and Mark Bradley.  The code was implemented by Robert Lipe
+       Information on the Garmin Mapsource format was provided by Ian
+       Cowley and Mark Bradley.  The code was implemented by Robert Lipe
        and Mark Bradley.
 
        Additional options:
-         snlen -        set the length of generated shortnames
-         mpsverout -    set the data format version of the output file
+         snlen -               set the length of generated shortnames
+         mpsverout -   set the data format version of the output file
                        (3,4 or 5)
+         mpsmergeout - if the output file already exists, then the output
+                                       is merged with it. This allows MapSource sections
+                                       not being handled to remain intact (e.g. map sets)
 
     PCX
 
@@ -414,6 +417,13 @@ THE FORMATS
 
        http://www.navicache.com/cgi-bin/ib312a/ikonboard.cgi?act=ST;f=23;t=334
 
+       PsiTrex
+       
+       This is a text format created by KuDaTa's PsiTrex program for the Psion
+       PDAs. The format can't be readily handled by XCSV, so this format is
+       handled explicitly.  Waypoints, routes and tracks are all handled, with
+       icon names used corresponding to verison 1.13 of PsiTrex.
+       
 DATA FILTERS
 
        GPSBabel supports data filtering.  Data filters are invoked from
index fea48868d1807107616445be8c503d74627775ce..979df34929400b93551bb370e31ed158f7c993f1 100644 (file)
@@ -205,6 +205,7 @@ void waypt_flush_all();
 unsigned int waypt_count(void);
 void free_gpx_extras (xml_tag * tag);
 void xcsv_read_internal_style(const char *style_buf);
+waypoint * find_waypt_by_name(const char *name);
 
 route_head *route_head_alloc(void);
 void route_add (waypoint *);
index c6481f2f561a7287dde07b4607b8be8abe262e63..ada2a8bdcb0c95c35c69a521381b68bda9ee13d1 100644 (file)
@@ -174,6 +174,7 @@ static icon_mapping_t icon_table[] = {
        {    62,   176, "Truck Stop" },
        {   103,  8243, "Tunnel" },
        {   114, 16394, "Ultralight Area" },
+       {   139,  8282, "Water Hydrant" },      /* new in MapSource V5 */
        {    18,    18, "Waypoint" },
        {    17,    17, "White Buoy" },
        {    35,    36, "White Dot" },
index 112464070785420dbb590cf2a172caa0adea7617..90011ea24501c21caa06a67c607a66e95afe0ccb 100644 (file)
 #include "garmin_tables.h"
 #include <ctype.h>
 
-static FILE *mps_file_in;
-static FILE *mps_file_out;
-static FILE *mps_file_temp;
-static void *mkshort_handle;
+static FILE    *mps_file_in;
+static FILE    *mps_file_out;
+static FILE    *mps_file_temp;
+static void    *mkshort_handle;
 
-static int     mps_ver_in = 0;
-static int     mps_ver_out = 0;
-static int     mps_ver_temp = 0;
+static int             mps_ver_in = 0;
+static int             mps_ver_out = 0;
+static int             mps_ver_temp = 0;
+
+/* Temporary pathname used when merging gpsbabel output with an existing file */
+static char    tempname[256];
+static char    origname[256];
+
+static const waypoint  *prevRouteWpt;
 
 #define MYNAME "MAPSOURCE" 
 #define ISME 0
 #define NOTME 1
 
-/*
- *  File header.  MsRcd ... Nov_18_2002 14:11:40
- */
-char mps_hdr[] = {
-       0x4d, 0x73, 0x52, 0x63, 0x64, 0x00, 0x02, 0x00, 
-       0x00, 0x00, 0x44, 0x67, 0x00, 0x1b, 0x00, 0x00,
-       0x00, 0x41, 0x96, 0x01, 0x53, 0x51, 0x41, 0x00, 
-       0x4f, 0x63, 0x74, 0x20, 0x32, 0x32, 0x20, 0x32,
-       0x30, 0x30, 0x31, 0x00, 0x31, 0x35, 0x3a, 0x34, 
-       0x35, 0x3a, 0x30, 0x35, 0x00
-}; 
-
-char mps_ftr[] = {
-       0x02, 0x00, 0x00, 0x00, 0x56, 0x00, 0x01
-};
-
 char *snlen;
 char *mpsverout;
+char *mpsmergeout = NULL;
 
 static
 arglist_t mps_args[] = {
        {"snlen", &snlen, "Length of generated shortnames", ARGTYPE_INT },
        {"mpsverout", &mpsverout, "Version of mapsource file to generate (3,4,5)", ARGTYPE_INT },
+       {"mpsmergeout", &mpsmergeout, "Merge output with existing file", ARGTYPE_BOOL },
        {0, 0, 0, 0}
 };
 
+static void 
+mps_noop(const route_head *wp)
+{
+       /* no-op */
+}
+
 const char *
 mps_find_desc_from_icon_number(const int icon, garmin_formats_e garmin_format)
 {
@@ -113,6 +111,50 @@ mps_find_icon_number_from_desc(const char *desc, garmin_formats_e garmin_format)
        return def_icon;
 }
 
+int mps_converted_icon_number(const int icon_num, const int mpsver, garmin_formats_e garmin_format)
+{
+       int def_icon = 18;
+
+       switch (garmin_format) {
+       case MAPSOURCE:
+               if (mpsver == 5) return icon_num;
+               if (mpsver == 4) {
+                       /* Water hydrant */
+                       if (icon_num == 139) return def_icon;
+                       else return icon_num;
+               }
+               else {
+                       /* the Contact icons - V3 doesn't have anything like this */
+                       if ((icon_num >= 119) && (icon_num <= 138)) return def_icon;
+                       /* the Geocache icons - V3 use the Circle with X */
+                       if ((icon_num >= 117) && (icon_num <= 118)) return 65;
+                       /* Water hydrant */
+                       if (icon_num == 139) return def_icon;
+                       return icon_num;
+               }
+
+       case PCX:
+       case GARMIN_SERIAL:
+               if (mpsver == 5) return icon_num;
+               if (mpsver == 4) {
+                       /* Water hydrant */
+                       if (icon_num == 8282) return def_icon;
+                       else return icon_num;
+               }
+               /* the Contact icons - V3 doesn't have anything like this */
+               if ((icon_num >= 8257) && (icon_num <= 8276)) return def_icon;
+               /* the Geocache icons - V3 use the Circle with X */
+               if ((icon_num >= 8255) && (icon_num <= 8256)) return 179;
+               /* Water hydrant */
+               if (icon_num == 8282) return def_icon;
+               return icon_num;
+
+       default:
+               fatal(MYNAME ": unknown garmin format");
+       }
+       return def_icon;
+}
+
 static void
 mps_rd_init(const char *fname)
 {
@@ -131,6 +173,30 @@ mps_rd_deinit(void)
 static void
 mps_wr_init(const char *fname)
 {
+       if (mpsmergeout) {
+               mps_file_out = fopen(fname, "rb");
+               if (mps_file_out == NULL) {
+                       mpsmergeout = NULL;
+               }
+               else {
+                       fclose(mps_file_out);
+                       srand((unsigned) time(NULL));
+
+                       for (;;) {
+                               /* create a temporary name  based on a random char and the existing name */
+                               /* then test if it already exists, if so try again with another rand num */
+                               /* yeah, yeah, so there's probably a library function for this           */
+                               sprintf(tempname, "%s.%08x", fname, rand());
+                               mps_file_temp = fopen(tempname, "rb");
+                               if (mps_file_temp == NULL) break;
+                               fclose(mps_file_temp);
+                       }
+                       rename(fname, tempname);
+                       mps_file_temp = fopen(tempname, "rb");
+                       strcpy(origname, fname);        /* save in case we need to revert the renamed file */
+               }
+       }
+
        mps_file_out = fopen(fname, "wb");
        if (mps_file_out == NULL) {
                fatal(MYNAME ": '%s' for writing\n", fname);
@@ -142,6 +208,11 @@ static void
 mps_wr_deinit(void)
 {
        fclose(mps_file_out);
+
+       if (mpsmergeout) {
+               fclose(mps_file_temp);
+               remove(tempname);
+       }
 }
 
 /*
@@ -162,7 +233,7 @@ mps_readstr(FILE *mps_file, char *buf, size_t sz)
 
 /*
  * read in from file to check a) valid format b) version of data formating
- * //MRCB
+ * MRCB
  */
 static void
 mps_fileHeader_r(FILE *mps_file, int *mps_ver)
@@ -180,6 +251,7 @@ mps_fileHeader_r(FILE *mps_file, int *mps_ver)
        /* Read the "format details" in plus the trailing null */
        fread( hdr, 3, 1, mps_file);
        if (hdr[0] != 'D')  {
+               /* No flag for the "data" section */
                fatal(MYNAME ": This doesn't look like a mapsource file.\n");
        }
        if (hdr[1] == 'd')  {
@@ -205,7 +277,7 @@ mps_fileHeader_r(FILE *mps_file, int *mps_ver)
 
 /*
  * write out to file 
- * //MRCB
+ * MRCB
  */
 static void
 mps_fileHeader_w(FILE *mps_file, int mps_ver)
@@ -216,28 +288,26 @@ mps_fileHeader_w(FILE *mps_file, int mps_ver)
        strcpy (hdr, "MsRc");
        fwrite(hdr, 4, 1, mps_file);
 
-       /* Between versions 3 & 5 this value is 'd', but might change in 
-        * the future
-        */
+       /* Between versions 3 & 5 this value is 'd', but might change in the future */
        strcpy(hdr, "d");
        fwrite(hdr, 2, 1, mps_file);    /* include trailing NULL char */
 
-       /* Seemingly another version related char */
+       /* Start of a "Data" section */
        hdr[0] = 'D';
-       /* if (mps_ver == 3)  */
-       hdr[1] = 'd';   /* equates to V3.02 */
-       if (mps_ver == 4) hdr[1] = 'g'; /* equates to V4.06 */
-       if (mps_ver == 5) hdr[1] = 'i'; /* equates to V5.0 */
+       /* if (mps_ver == 3) */
+       hdr[1] = 'd';                                           /* equates to V3.02 */
+       if (mps_ver == 4) hdr[1] = 'g';         /* equates to V4.06 */
+       if (mps_ver == 5) hdr[1] = 'i';         /* equates to V5.0 */
        hdr[2] = 0;
 
-       reclen = 2;                                             /* this is 3 byte record */
+       reclen = 2;                                                     /* this is 3 byte record */
        le_write32(&reclen, reclen);
        fwrite(&reclen, 4, 1, mps_file);
-       fwrite(hdr, 3, 1, mps_file);    /* reclen + 1 */
+       fwrite(hdr, 3, 1, mps_file);            /* reclen + 1 */
 
        hdr[0] = 'A';
-       /* if (mps_ver == 3)  */
-       hdr[1] = 0x2E; hdr[2] = 0x01;   /* equates to V3.02 */
+       /* if (mps_ver == 3) */
+       hdr[1] = 0x2E; hdr[2] = 0x01;           /* equates to V3.02 */
        hdr[3] = 'S'; 
        hdr[4] = 'Q'; 
        hdr[5] = 'A';
@@ -245,26 +315,26 @@ mps_fileHeader_w(FILE *mps_file, int mps_ver)
        strcpy(hdr+7,"Oct 20 1999");
        strcpy(hdr+19,"12:50:03");
        if (mps_ver == 4) {
-               hdr[1] = 0x96;  /* equates to V4.06 */
+               hdr[1] = 0x96;                                  /* equates to V4.06 */
                strcpy(hdr+7,"Oct 22 2001");
                strcpy(hdr+19,"15:45:05");
        }
        if (mps_ver == 5) {
-               hdr[1] = 0xF4;  /* equates to V5.0 */
+               hdr[1] = 0xF4;                                  /* equates to V5.0 */
                strcpy(hdr+7,"Jul  3 2003");
                strcpy(hdr+19,"08:35:39");
        }
 
-       reclen = 27;                                    /* pre measured! */
+       reclen = 27;                                            /* pre measured! */
        le_write32(&reclen, reclen);
        fwrite(&reclen, 4, 1, mps_file);
-       fwrite(hdr, 28, 1, mps_file);   /* reclen + 1  - can't use this as reclen may be wrongendian now */
+       fwrite(hdr, 28, 1, mps_file);           /* reclen + 1  - can't use this as reclen may be wrongendian now */
 }
 
 /*
  * read in from file a mapsetname record
  * there should always be one of these at the end of the file
- * //MRCB
+ * MRCB
  */
 static int
 mps_mapsetname_r(FILE *mps_file, int mps_ver)
@@ -277,15 +347,14 @@ mps_mapsetname_r(FILE *mps_file, int mps_ver)
 
        fread(hdr, 1, 1, mps_file);
        if (hdr[0] == 'V') {
-               /* this IS a mapsetname
+               /* this IS a mapsetname */
                
-               // At the moment we're not doing anything with mapsetnames, but here's the template code as if we were
-               // mps_readstr(mps_file, hdr, sizeof(hdr));
-               // char mapsetnamename[very large number?];
-               // strcpy(mapsetnamename,hdr);
-               // char mapsetnameAutonameFlag;
-               // fread(&mapsetnameAutonameFlag, 1, 1, mps_file);
-               */
+               /* At the moment we're not doing anything with mapsetnames, but here's the template code as if we were
+               mps_readstr(mps_file, hdr, sizeof(hdr));
+               char mapsetnamename[very large number?];
+               strcpy(mapsetnamename,hdr);
+               char mapsetnameAutonameFlag;
+               fread(&mapsetnameAutonameFlag, 1, 1, mps_file); */
 
                fseek( mps_file, reclen, SEEK_CUR); 
                return ISME;
@@ -301,7 +370,7 @@ mps_mapsetname_r(FILE *mps_file, int mps_ver)
 /*
  * write out to file a mapsetname record
  * there should always be one of these at the end of the file
- * //MRCB
+ * MRCB
  */
 static void
 mps_mapsetname_w(FILE *mps_file, int mps_ver)
@@ -321,13 +390,11 @@ mps_mapsetname_w(FILE *mps_file, int mps_ver)
 
 /*
  * read in from file a waypoint record
- * //MRCB
+ * MRCB
  */
-static int
+static void
 mps_waypoint_r(FILE *mps_file, int mps_ver, waypoint **wpt)
 {
-       unsigned char hdr[100];
-       int reclen;
        char tbuf[100];
        char wptname[256];
        char wptdesc[256];
@@ -340,99 +407,88 @@ mps_waypoint_r(FILE *mps_file, int mps_ver, waypoint **wpt)
        double  mps_proximity = unknown_alt;
        double  mps_depth = unknown_alt;
 
-       fread(&reclen, 4, 1, mps_file);
-               reclen = le_read32(&reclen);
+       thisWaypoint = xcalloc(sizeof(*thisWaypoint), 1);
+       *wpt = thisWaypoint;
 
-       fread(hdr, 1, 1, mps_file);
+       mps_readstr(mps_file, wptname, sizeof(wptname));
 
-       if (hdr[0] == 'W') {
-               /* this IS a waypoint */
-               
-               thisWaypoint = xcalloc(sizeof(*thisWaypoint), 1);
-               *wpt = thisWaypoint;
+       if ((mps_ver == 4) || (mps_ver == 5)) {
+               fread(tbuf, 4, 1, mps_file);                            /* class */
+               mps_readstr(mps_file, tbuf, sizeof(tbuf));      /* country */
+       }
 
-               mps_readstr(mps_file, wptname, sizeof(wptname));
+       fread(tbuf, 22, 1, mps_file);                                   /* unknown */
 
-               if ((mps_ver == 4) || (mps_ver == 5)) {
-                       fread(tbuf, 4, 1, mps_file);            /* class */
-                       mps_readstr(mps_file, tbuf, sizeof(tbuf));      /* country */
-               }
+       fread(&lat, 4, 1, mps_file); 
+       fread(&lon, 4, 1, mps_file); 
+       lat = le_read32(&lat);
+       lon = le_read32(&lon);
+       
+       fread(tbuf, 1, 1, mps_file);                                    /* altitude validity */
+       if (tbuf[0] == 1) {
+               fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);
+       }
+       else {
+               mps_altitude = unknown_alt;
+               fread(tbuf,sizeof(mps_altitude),1, mps_file);
+       }
 
-               fread(tbuf, 22, 1, mps_file);                   /* unknown */
+       mps_readstr(mps_file, wptdesc, sizeof(wptdesc));
 
-               fread(&lat, 4, 1, mps_file); 
-               fread(&lon, 4, 1, mps_file); 
-               lat = le_read32(&lat);
-               lon = le_read32(&lon);
-               
-               fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
-               if (tbuf[0] == 1) {
-                       fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);
-               }
-               else {
-                       mps_altitude = unknown_alt;
-                       fread(tbuf,sizeof(mps_altitude),1, mps_file);
-               }
+       fread(tbuf, 1, 1, mps_file);                    /* proximity validity */
+       if (tbuf[0] == 1) {
+               fread(&mps_proximity,sizeof(mps_proximity),1,mps_file);
+       }
+       else {
+               mps_proximity = unknown_alt;
+               fread(tbuf,sizeof(mps_proximity),1, mps_file);
+       }
 
-               mps_readstr(mps_file, wptdesc, sizeof(wptdesc));
+       fread(tbuf, 4, 1, mps_file);                    /* display flag */
+       fread(tbuf, 4, 1, mps_file);                    /* colour */
+       fread(&icon, 4, 1, mps_file);                   /* display symbol */
+       icon = le_read32(&icon);
 
-               fread(tbuf, 1, 1, mps_file);                    /* proximity validity */
-               if (tbuf[0] == 1) {
-                       fread(&mps_proximity,sizeof(mps_proximity),1,mps_file);
-               }
-               else {
-                       mps_proximity = unknown_alt;
-                       fread(tbuf,sizeof(mps_proximity),1, mps_file);
-               }
+       mps_readstr(mps_file, tbuf, sizeof(tbuf));              /* city */
+       mps_readstr(mps_file, tbuf, sizeof(tbuf));              /* state */
+       mps_readstr(mps_file, tbuf, sizeof(tbuf));              /*facility */
 
-               fread(tbuf, 4, 1, mps_file);                    /* display flag */
-               fread(tbuf, 4, 1, mps_file);                    /* colour */
-               fread(&icon, 4, 1, mps_file);                   /* display symbol */
-               icon = le_read32(&icon);
+       fread(tbuf, 1, 1, mps_file);                    /* unknown */
 
-               mps_readstr(mps_file, tbuf, sizeof(tbuf));              /* city */
-               mps_readstr(mps_file, tbuf, sizeof(tbuf));              /* state */
-               mps_readstr(mps_file, tbuf, sizeof(tbuf));              /*facility */
+       fread(tbuf, 1, 1, mps_file);                    /* depth validity */
+       if (tbuf[0] == 1) {
+               fread(&mps_depth,sizeof(mps_depth),1,mps_file);
+       }
+       else {
+               mps_depth = unknown_alt;
+               fread(tbuf,sizeof(mps_depth),1, mps_file);
+       }
 
-               fread(tbuf, 1, 1, mps_file);                    /* unknown */
+       if ((mps_ver == 4) || (mps_ver == 5)) {
+               fread(tbuf, 7, 1, mps_file);            /* unknown */
+       }
+       else {
+               fread(tbuf, 2, 1, mps_file);            /* unknown */
+       }
 
-               fread(tbuf, 1, 1, mps_file);                    /* depth validity */
-               if (tbuf[0] == 1) {
-                       fread(&mps_depth,sizeof(mps_depth),1,mps_file);
-               }
-               else {
-                       mps_depth = unknown_alt;
-                       fread(tbuf,sizeof(mps_depth),1, mps_file);
-               }
+       thisWaypoint->shortname = xstrdup(wptname);
+       thisWaypoint->description = xstrdup(wptdesc);
+       thisWaypoint->position.latitude.degrees = lat / 2147483648.0 * 180.0;
+       thisWaypoint->position.longitude.degrees = lon / 2147483648.0 * 180.0;
+       thisWaypoint->position.altitude.altitude_meters = mps_altitude;
 
-               if ((mps_ver == 4) || (mps_ver == 5)) {
-                       fread(tbuf, 7, 1, mps_file);            /* unknown */
-               }
-               else {
-                       fread(tbuf, 2, 1, mps_file);            /* unknown */
-               }
+       /* might need to change this to handle version dependent icon handling */
+       thisWaypoint->icon_descr = mps_find_desc_from_icon_number(icon, MAPSOURCE);
+       waypt_add(thisWaypoint);
 
-               thisWaypoint->shortname = xstrdup(wptname);
-               thisWaypoint->description = xstrdup(wptdesc);
-               thisWaypoint->position.latitude.degrees = lat / 2147483648.0 * 180.0;
-               thisWaypoint->position.longitude.degrees = lon / 2147483648.0 * 180.0;
-               thisWaypoint->position.altitude.altitude_meters = mps_altitude;
-               thisWaypoint->icon_descr = mps_find_desc_from_icon_number(icon, MAPSOURCE);
-               /* waypt_add(thisWaypoint); */
+       return;
 
-               return ISME;
-       }
-       else {
-               /* Not a waypoint */
-               fseek(mps_file, -5, SEEK_CUR); 
-               return NOTME;
-       }
 }
 
 /*
  * write out to file a waypoint record
- * //MRCB
               */
+ * MRCB
+ */
 static void
 mps_waypoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt)
 {
@@ -443,8 +499,8 @@ mps_waypoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt)
        int     icon;
        char *src;
        char *ident;
-       char zbuf[100];
-       char ffbuf[100];
+       char zbuf[25];
+       char ffbuf[25];
        int display = 1;
        int colour = 0;                 /*  (unknown colour) black is 1, white is 16 */
 
@@ -461,13 +517,17 @@ mps_waypoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt)
        memset(zbuf, 0, sizeof(zbuf));
        memset(ffbuf, 0xff, sizeof(ffbuf));
 
+       /* might need to change this to handle version dependent icon handling */
        icon = mps_find_icon_number_from_desc(wpt->icon_descr, MAPSOURCE);
 
        if (get_cache_icon(wpt) && wpt->icon_descr && (strcmp(wpt->icon_descr, "Geocache Found") != 0)) {
                icon = mps_find_icon_number_from_desc(get_cache_icon(wpt), MAPSOURCE);
        }
 
-       reclen = strlen(ident) + strlen(wpt->description) + 2;  /* two NULL (0x0) bytes at end of each string */
+       icon = mps_converted_icon_number(icon, mps_ver, MAPSOURCE);
+
+       /* two NULL (0x0) bytes at end of each string */
+       reclen = strlen(ident) + ((wpt->description) ? strlen(wpt->description) : 0) + 2;       
        if ((mps_ver == 4) || (mps_ver == 5)) {
                /* v4.06 & V5.0*/
                reclen += 85;                           /* "W" (1) + strlen(name) + NULL (1) + class(4) + country(sz) +  
@@ -519,7 +579,7 @@ mps_waypoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt)
                fwrite(&mps_altitude, 8 , 1, mps_file);
        }
 
-       fputs(wpt->description, mps_file);
+       if (wpt->description) fputs(wpt->description, mps_file);
        fwrite(zbuf, 1, 1, mps_file);   /* NULL termination */
 
        if (mps_proximity == unknown_alt) {
@@ -566,185 +626,750 @@ mps_waypoint_w_wrapper(const waypoint *wpt)
 }
 
 /*
- * read in from file a track record
- * //MRCB
+ * read in from file a route record
+ * MRCB
  */
-static int
-mps_track_r(FILE *mps_file, int mps_ver, route_head **trk)
+static void
+mps_route_r(FILE *mps_file, int mps_ver, route_head **rte)
 {
-       unsigned char hdr[100];
-       int reclen;
        char tbuf[100];
-       char trkname[256];
+       char rtename[256];
+       char wptname[256];
        int lat;
        int lon;
+       short int       rte_autoname = 0;
+       int     interlinkStepCount;
+       int     thisInterlinkStep;
 
        time_t  dateTime = 0;
-       route_head *track_head;
-       unsigned int trk_count;
+       route_head *rte_head;
+       unsigned int rte_count;
 
        waypoint        *thisWaypoint;
+       waypoint        *tempWpt;
+
        double  mps_altitude = unknown_alt;
        double  mps_depth = unknown_alt;
 
 
-       fread(&reclen, 4, 1, mps_file);
-       reclen = le_read32(&reclen);
+       mps_readstr(mps_file, rtename, sizeof(rtename));
+       fread(&rte_autoname, 2, 1, mps_file);   /* autoname flag */
+       rte_autoname = le_read16(&rte_autoname);
 
-       fread(hdr, 1, 1, mps_file);
+       fread(&lat, 4, 1, mps_file); 
+       fread(&lon, 4, 1, mps_file); 
+       lat = le_read32(&lat);                  /* max lat of whole route */
+       lon = le_read32(&lon);                  /* max lon of whole route */
+
+       fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
+       if (tbuf[0] == 1) {
+               fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);   /* max alt of the whole route */
+       }
+       else {
+               mps_altitude = unknown_alt;
+               fread(tbuf,sizeof(mps_altitude),1, mps_file);
+       }
+
+       fread(&lat, 4, 1, mps_file); 
+       fread(&lon, 4, 1, mps_file); 
+       lat = le_read32(&lat);                  /* min lat of whole route */
+       lon = le_read32(&lon);                  /* min lon of whole route */
+
+       fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
+       if (tbuf[0] == 1) {
+               fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);   /* min alt of the whole route */
+       }
+       else {
+               mps_altitude = unknown_alt;
+               fread(tbuf,sizeof(mps_altitude),1, mps_file);
+       }
 
-       if (hdr[0] == 'T') {
-               /* this IS a track */
+       fread(&rte_count, 4, 1, mps_file);                      /* number of waypoints in route */
+       rte_count = le_read32(&rte_count);
 
-               mps_readstr(mps_file, trkname, sizeof(trkname));
-               fread(tbuf, 1, 1, mps_file);                    /* display flag */
-               fread(tbuf, 4, 1, mps_file);                    /* colour */
+       rte_head = route_head_alloc();
+       rte_head->rte_name = xstrdup(rtename);
+       route_add_head(rte_head);
+       *rte = rte_head;
 
-               fread(&trk_count, 4, 1, mps_file);                      /* number of datapoints in tracklog */
-               trk_count = le_read32(&trk_count);
+       rte_count--;                    /* need to loop round for one less than the number of waypoints */
 
-               track_head = route_head_alloc();
-               track_head->rte_name = xstrdup(trkname);
-               route_add_head(track_head);
-               *trk = track_head;
+       while (rte_count--) {
 
-               while (trk_count--) {
+               mps_readstr(mps_file, wptname, sizeof(wptname));
+               if ((mps_ver == 4) || (mps_ver == 5)) {
+                       fread(tbuf, 4, 1, mps_file);                            /* class */
+                       mps_readstr(mps_file, tbuf, sizeof(tbuf));      /* country */
+                       fread(tbuf, 22, 1, mps_file);                           /* unknown */
+                       fread(tbuf, 19, 1, mps_file);                           /* unknown */
+               }
+               else {
+                       fread(tbuf, 22, 1, mps_file);                           /* unknown */
+                       fread(tbuf, 18, 1, mps_file);                           /* unknown */
+               }
 
-                       fread(&lat, 4, 1, mps_file); 
-                       fread(&lon, 4, 1, mps_file); 
+               /* link details */
+               fread(&interlinkStepCount, 4, 1, mps_file);                                     /* supposedly always 2 */
+               interlinkStepCount = le_read32(&interlinkStepCount);
+               /* first end of link */
+               fread(&lat, 4, 1, mps_file); 
+               fread(&lon, 4, 1, mps_file); 
                lat = le_read32(&lat);
                lon = le_read32(&lon);
-               
-                       fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
-                       if (tbuf[0] == 1) {
-                               fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);
-                       }
-                       else {
-                               mps_altitude = unknown_alt;
-                               fread(tbuf,sizeof(mps_altitude),1, mps_file);
-                       }
-
-                       fread(tbuf, 1, 1, mps_file);                    /* date/time validity */
-                       if (tbuf[0] == 1) {
-                               fread(&dateTime,sizeof(dateTime),1,mps_file);
-                       }
-                       else {
-                               fread(tbuf,sizeof(dateTime),1, mps_file);
-                       }
+       
+               fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
+               if (tbuf[0] == 1) {
+                       fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);
+               }
+               else {
+                       mps_altitude = unknown_alt;
+                       fread(tbuf,sizeof(mps_altitude),1, mps_file);
+               }
 
-                       fread(tbuf, 1, 1, mps_file);                    /* depth validity */
-                       if (tbuf[0] == 1) {
-                               fread(&mps_depth,sizeof(mps_depth),1,mps_file);
-                       }
-                       else {
-                               mps_depth = unknown_alt;
-                               fread(tbuf,sizeof(mps_depth),1, mps_file);
-                       }
+               /* with MapSource routes, the real waypoint details are held as a separate waypoint, so copy from there
+                  if found */
+               tempWpt = find_waypt_by_name(wptname);
 
+               if (tempWpt != NULL) {
+                       thisWaypoint = waypt_dupe(tempWpt);
+               }
+               else {
                        thisWaypoint = xcalloc(sizeof(*thisWaypoint), 1);
+                       thisWaypoint->shortname = xstrdup(wptname);
                        thisWaypoint->position.latitude.degrees = lat / 2147483648.0 * 180.0;
                        thisWaypoint->position.longitude.degrees = lon / 2147483648.0 * 180.0;
-                       thisWaypoint->creation_time = dateTime;
-                       thisWaypoint->centiseconds = 0;
                        thisWaypoint->position.altitude.altitude_meters = mps_altitude;
-                       route_add_wpt(track_head, thisWaypoint);
-/* Mark, why is this here:     thisWaypoint->position.longitude.degrees); */
+               }
 
-               }               /* while (trk_count--) */
-               return ISME;
+               route_add_wpt(rte_head, thisWaypoint);
+
+               /* take two off the count since we separately read the start and end parts of the link */
+               for (thisInterlinkStep = interlinkStepCount - 2; thisInterlinkStep > 0; thisInterlinkStep--) {
+                       /* Could do this by doing a calculation on length of each co-ordinate and just doing one read
+                          but doing it this way makes it easier in the future to make use of this data */
+                       fread(tbuf, 4, 1, mps_file);    /* lat */
+                       fread(tbuf, 4, 1, mps_file);    /* lon */
+                       fread(tbuf, 1, 1, mps_file);    /* altitude validity */
+                       fread(tbuf, 8, 1, mps_file);    /* altitude */
+               }
+
+               /* other end of link */
+               fread(&lat, 4, 1, mps_file); 
+               fread(&lon, 4, 1, mps_file); 
+               lat = le_read32(&lat);
+               lon = le_read32(&lon);
+       
+               fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
+               if (tbuf[0] == 1) {
+                       fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);
+               }
+               else {
+                       mps_altitude = unknown_alt;
+                       fread(tbuf,sizeof(mps_altitude),1, mps_file);
+               }
+
+               fread(tbuf, 1, 1, mps_file);                    /* NULL */
+
+               fread(tbuf, 4, 1, mps_file);                    /* link max lat */
+               fread(tbuf, 4, 1, mps_file);                    /* link max lon */
+               fread(tbuf, 9, 1, mps_file);                    /* link max alt validity + alt */
+
+               fread(tbuf, 4, 1, mps_file);                    /* link min lat */
+               fread(tbuf, 4, 1, mps_file);                    /* link min lon */
+               fread(tbuf, 9, 1, mps_file);                    /* link min alt validity + alt */
+
+       }               /* while (trk_count--) */
+
+       /* when the loop is done, there's still one waypoint to read with a small trailer */
+       /* all we want is the waypoint name; lat, lon and alt are already set from above  */
+       mps_readstr(mps_file, wptname, sizeof(wptname));
+
+       if ((mps_ver == 4) || (mps_ver == 5)) {
+               fread(tbuf, 4, 1, mps_file);                            /* class */
+               mps_readstr(mps_file, tbuf, sizeof(tbuf));      /* country */
+               fread(tbuf, 22, 1, mps_file);                           /* unknown */
+               fread(tbuf, 19, 1, mps_file);                           /* unknown */
        }
        else {
-               /* Not a track */
-               fseek(mps_file, -5, SEEK_CUR); 
-               return NOTME;
+               fread(tbuf, 22, 1, mps_file);                           /* unknown */
+               fread(tbuf, 18, 1, mps_file);                           /* unknown */
+       }
+
+       fread(tbuf, 5, 1, mps_file);                                    /* 5 byte trailer */
+       /* with MapSource routes, the real waypoint details are held as a separate waypoint, so copy from there
+               if found */
+       tempWpt = find_waypt_by_name(wptname);
+
+       if (tempWpt != NULL) {
+               thisWaypoint = waypt_dupe(tempWpt);
+       }
+       else {
+               thisWaypoint = xcalloc(sizeof(*thisWaypoint), 1);
+               thisWaypoint->shortname = xstrdup(wptname);
+               thisWaypoint->position.latitude.degrees = lat / 2147483648.0 * 180.0;
+               thisWaypoint->position.longitude.degrees = lon / 2147483648.0 * 180.0;
+               thisWaypoint->position.altitude.altitude_meters = mps_altitude;
        }
+
+       route_add_wpt(rte_head, thisWaypoint);
+
+       return;
 }
 
 /*
- * write out to file a tracklog header
- * //MRCB
+ * write out to file a route header
+ * MRCB
  */
 static void
-mps_trackhdr_w(FILE *mps_file, int mps_ver, const route_head *trk)
+mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte)
 {
        unsigned int reclen;
-       unsigned int trk_datapoints;
+       unsigned int rte_datapoints;
        unsigned int colour = 0;                /* unknown colour */
-       int             tname_len;
-       char *tname;
-       char hdr[2];
+       int                     rname_len;
+       char            *rname;
+       char            hdr[20];
+       char            zbuf[20];
+       char            *src;
+       char            *ident;
+
+       waypoint        *testwpt;
+       time_t          uniqueValue;
+       int                     allWptNameLengths;
+
+       double          maxlat=-90.0;
+       double          maxlon=-180.0;
+       double          minlat=90.0;
+       double          minlon=180.0;
+       double          maxalt=unknown_alt;
+       double          minalt=unknown_alt;
+
+       int lat;
+       int lon;
 
        queue *elem, *tmp;
 
-       /* track name */
-       if (!trk->rte_name)
-               tname = xstrdup("Track");
-       else
-               tname = xstrdup(trk->rte_name);
+       prevRouteWpt = NULL;            /* clear the stateful flag used to know when the start of route wpts happens */
 
-       tname_len = strlen(tname);
-       reclen = tname_len + 11;                /* "T" (1) + strlen(tname) + NULL (1) + display flag (1) + colour (4) +
-                                                                          num track datapoints value (4) */
-       
-       /* total nodes (waypoints) this track */
-       trk_datapoints = 0;
-       QUEUE_FOR_EACH(&trk->waypoint_list, elem, tmp) {
-               trk_datapoints++;
-       }               
+       memset(zbuf, 0, sizeof(zbuf));
 
-       reclen += (trk_datapoints * 31) - 1;    /* lat (4) + lon (4) + alt (9) + date (5) + depth (9) ;*/
-                                                                                       /* -1 is because reclen starts from 0 which means a length of 1 */
-       le_write32(&reclen, reclen);
-       fwrite(&reclen, 4, 1, mps_file);
+       /* total nodes (waypoints) this route */
+       rte_datapoints = 0;
+       allWptNameLengths = 0;
 
-       hdr[0] = 'T';
-       fwrite(hdr, 1, 1, mps_file);
+       if (rte->waypoint_list.next) {          /* this test doesn't do what I want i.e test if this is a valid route - treat as a placeholder for now */
+               QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
+                       testwpt = (waypoint *)elem;
+                       if (rte_datapoints == 0) {
+                               uniqueValue = testwpt->creation_time;
+                       }
+                       if (testwpt->position.latitude.degrees > maxlat) maxlat = testwpt->position.latitude.degrees;
+                       if (testwpt->position.latitude.degrees < minlat) minlat = testwpt->position.latitude.degrees;
+                       if (testwpt->position.longitude.degrees > maxlon) maxlon = testwpt->position.longitude.degrees;
+                       if (testwpt->position.longitude.degrees < minlon) minlon = testwpt->position.longitude.degrees;
+                       if (testwpt->position.altitude.altitude_meters != unknown_alt) {
+                               if ((testwpt->position.altitude.altitude_meters > maxalt) || 
+                                       (maxalt == unknown_alt)) maxalt = testwpt->position.altitude.altitude_meters;
+                               if ((testwpt->position.altitude.altitude_meters < minalt) ||
+                                       (minalt == unknown_alt)) minalt = testwpt->position.altitude.altitude_meters;
+                       }
 
-       fwrite(tname, tname_len, 1, mps_file);
-       xfree(tname);
+                       if(testwpt->description) src = testwpt->description;
+                       if(testwpt->notes) src = testwpt->notes;
+                       ident = global_opts.synthesize_shortnames ?
+                                               mkshort(mkshort_handle, src) :
+                                               testwpt->shortname;
+                       allWptNameLengths += strlen(ident) + 1;
 
-       hdr[0] = 0;
-       hdr[1] = 1;
-       fwrite(hdr, 2, 1, mps_file);    /* NULL string terminator + display flag */
+                       rte_datapoints++;
+               }               
 
-       le_write32(&colour, colour);
-       fwrite(&colour, 4, 1, mps_file);
+               if (uniqueValue == 0) {
+                       uniqueValue = time(NULL);
+               }
+
+               /* route name */
+               if (!rte->rte_name) {
+                       sprintf(hdr, "Route%04x", uniqueValue);
+                       rname = xstrdup(hdr);
+               }
+               else
+                       rname = xstrdup(rte->rte_name);
+
+               rname_len = strlen(rname);
+               reclen = rname_len + 42;                /* "T" (1) + strlen(tname) + NULL (1) + autoname flag (2) + 
+                                                                               route lat lon max (2x4) + route max alt (9) +
+                                                                               route lat lon min (2x4) + route min alt (9) +
+                                                                               num route datapoints value (4) */
+               
+               /* V3 - each waypoint: waypoint name + NULL (1) + unknown (22) + unknown (18) */
+               /* V4,5 - each waypoint: waypoint name + NULL (1) + class (4) + country + NULL (1) + 
+                                                               unknown (22) + unknown (19) */
+               /* V* - each route link: 0x00000002 (4) + end 1 lat (4) + end 1 lon (4) + end 1 alt (9) +
+                                                               end 2 lat (4) + end 2 lon (4) + end 2 alt (9) + NULL (1) +
+                                                               link max lat (4) + link max lon (4) + link max alt (9) +
+                                                               link min lat (4) + link min lon (4) + link min alt (9) */
+
+               if ((mps_ver == 4) || (mps_ver == 5)) {
+                       reclen += allWptNameLengths + rte_datapoints * 46 + 
+                                       (rte_datapoints - 1) * 73 + 4;                          /* link details plus overall trailing bytes */
+               }
+               else {
+                       reclen += allWptNameLengths + rte_datapoints * 40 + 
+                                       (rte_datapoints - 1) * 73 + 4;                          /* link details plus overall trailing bytes */
+               }
+
+               le_write32(&reclen, reclen);
+               fwrite(&reclen, 4, 1, mps_file);
+
+               hdr[0] = 'R';
+               fwrite(hdr, 1, 1, mps_file);
+
+               fwrite(rname, rname_len, 1, mps_file);
+               xfree(rname);
+
+               hdr[0] = 0;                                             /* NULL of string termination */
+               hdr[1] = 0;                                             /* don't autoname */
+               hdr[2] = 0;                                             /* MSB of don't autoname */
+               fwrite(hdr, 3, 1, mps_file);    /* NULL string terminator + route autoname flag */
+
+               lat = maxlat / 180.0 * 2147483648.0;
+               lon = maxlon / 180.0 * 2147483648.0;
+
+               le_write32(&lat, lat);
+               le_write32(&lon, lon);
+
+               fwrite(&lat, 4, 1, mps_file);
+               fwrite(&lon, 4, 1, mps_file);
 
-       le_write32(&trk_datapoints, trk_datapoints);
-       fwrite(&trk_datapoints, 4, 1, mps_file);
+               if (maxalt == unknown_alt) {
+                       fwrite(zbuf, 9, 1, mps_file);
+               }
+               else {
+                       hdr[0] = 1;
+                       fwrite(hdr, 1 , 1, mps_file);
+                       fwrite(&maxalt, 8 , 1, mps_file);
+               }
+
+               lat = minlat / 180.0 * 2147483648.0;
+               lon = minlon / 180.0 * 2147483648.0;
+
+               le_write32(&lat, lat);
+               le_write32(&lon, lon);
+
+               fwrite(&lat, 4, 1, mps_file);
+               fwrite(&lon, 4, 1, mps_file);
+
+               if (minalt == unknown_alt) {
+                       fwrite(zbuf, 9, 1, mps_file);
+               }
+               else {
+                       hdr[0] = 1;
+                       fwrite(hdr, 1 , 1, mps_file);
+                       fwrite(&minalt, 8 , 1, mps_file);
+               }
 
+               le_write32(&rte_datapoints, rte_datapoints);
+               fwrite(&rte_datapoints, 4, 1, mps_file);
+       }
 }
 
 static void
-mps_trackhdr_w_wrapper(const route_head *trk)
+mps_routehdr_w_wrapper(const route_head *rte)
 {
-       mps_trackhdr_w(mps_file_out, mps_ver_out, trk);
+       mps_routehdr_w(mps_file_out, mps_ver_out, rte);
 }
 
 
 /*
- * write out to file a tracklog datapoint
- * //MRCB
+ * write out to file a route datapoint
+ * MRCB
  */
 static void
-mps_trackdatapoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt)
+mps_routedatapoint_w(FILE *mps_file, int mps_ver, const waypoint *rtewpt)
 {
        unsigned char hdr[10];
-       int lat = wpt->position.latitude.degrees  / 180.0 * 2147483648.0;
-       int lon = wpt->position.longitude.degrees  / 180.0 * 2147483648.0;
-       time_t  t = wpt->creation_time;
-       char zbuf[10];
+       int lat;
+       int lon;
+       time_t  t = rtewpt->creation_time;
+       char zbuf[20];
+       char ffbuf[20];
+       char *src;
+       char *ident;
+       int                     reclen;
 
-       double  mps_altitude = wpt->position.altitude.altitude_meters;
-       double  mps_proximity = unknown_alt;
-       double  mps_depth = unknown_alt;
+       int                     maxlat;
+       int                     maxlon;
+       int                     minlat;
+       int                     minlon;
+       double          maxalt=unknown_alt;
+       double          minalt=unknown_alt;
+
+       double  mps_altitude;
 
        memset(zbuf, 0, sizeof(zbuf));
+       memset(ffbuf, 0xff, sizeof(ffbuf));
 
-       le_write32(&lat, lat);
-       le_write32(&lon, lon);
-       fwrite(&lat, 4, 1, mps_file);
-       fwrite(&lon, 4, 1, mps_file);
+       if (prevRouteWpt != NULL) {
+               /* output the route link details */
+               reclen = 2;
+               le_write32(&reclen, reclen);
+               fwrite(&reclen, 4, 1, mps_file);
+
+               /* output end point 1 */
+               lat = prevRouteWpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+               lon = prevRouteWpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+               le_write32(&lat, lat);
+               le_write32(&lon, lon);
+
+               fwrite(&lat, 4, 1, mps_file);
+               fwrite(&lon, 4, 1, mps_file);
+
+               mps_altitude = prevRouteWpt->position.altitude.altitude_meters;
+               if (mps_altitude == unknown_alt) {
+                       fwrite(zbuf, 9, 1, mps_file);
+               }
+               else {
+                       hdr[0] = 1;
+                       fwrite(hdr, 1 , 1, mps_file);
+                       fwrite(&mps_altitude, 8 , 1, mps_file);
+               }
+
+               /* output end point 2 */
+               lat = rtewpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+               lon = rtewpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+               le_write32(&lat, lat);
+               le_write32(&lon, lon);
+
+               fwrite(&lat, 4, 1, mps_file);
+               fwrite(&lon, 4, 1, mps_file);
+
+               mps_altitude = rtewpt->position.altitude.altitude_meters;
+               if (mps_altitude == unknown_alt) {
+                       fwrite(zbuf, 9, 1, mps_file);
+               }
+               else {
+                       hdr[0] = 1;
+                       fwrite(hdr, 1 , 1, mps_file);
+                       fwrite(&mps_altitude, 8 , 1, mps_file);
+               }
+
+               if (rtewpt->position.latitude.degrees > prevRouteWpt->position.latitude.degrees) {
+                       maxlat = rtewpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+                       minlat = prevRouteWpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+               }
+               else {
+                       minlat = rtewpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+                       maxlat = prevRouteWpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+               }
+
+               if (rtewpt->position.longitude.degrees > prevRouteWpt->position.longitude.degrees) {
+                       maxlon = rtewpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+                       minlon = prevRouteWpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+               }
+               else {
+                       minlon = rtewpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+                       maxlon = prevRouteWpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+               }
+
+               if (rtewpt->position.altitude.altitude_meters != unknown_alt) maxalt = rtewpt->position.altitude.altitude_meters;
+               if (rtewpt->position.altitude.altitude_meters != unknown_alt) minalt = rtewpt->position.altitude.altitude_meters;
+               if (prevRouteWpt->position.altitude.altitude_meters != unknown_alt) {
+                       if ((prevRouteWpt->position.altitude.altitude_meters > maxalt) || 
+                               (maxalt == unknown_alt)) maxalt = prevRouteWpt->position.altitude.altitude_meters;
+                       if ((prevRouteWpt->position.altitude.altitude_meters < minalt) ||
+                               (minalt == unknown_alt)) minalt = prevRouteWpt->position.altitude.altitude_meters;
+               }
+               
+               fwrite (zbuf, 1, 1, mps_file);
+
+               /* output max coords of the link */
+               le_write32(&maxlat, maxlat);
+               le_write32(&maxlon, maxlon);
+
+               fwrite(&maxlat, 4, 1, mps_file);
+               fwrite(&maxlon, 4, 1, mps_file);
+
+               if (maxalt == unknown_alt) {
+                       fwrite(zbuf, 9, 1, mps_file);
+               }
+               else {
+                       hdr[0] = 1;
+                       fwrite(hdr, 1 , 1, mps_file);
+                       fwrite(&maxalt, 8 , 1, mps_file);
+               }
+
+               /* output min coords of the link */
+               le_write32(&minlat, minlat);
+               le_write32(&minlon, minlon);
+
+               fwrite(&minlat, 4, 1, mps_file);
+               fwrite(&minlon, 4, 1, mps_file);
+
+               if (minalt == unknown_alt) {
+                       fwrite(zbuf, 9, 1, mps_file);
+               }
+               else {
+                       hdr[0] = 1;
+                       fwrite(hdr, 1 , 1, mps_file);
+                       fwrite(&minalt, 8 , 1, mps_file);
+               }
+
+       }
+
+       if(rtewpt->description) src = rtewpt->description;
+       if(rtewpt->notes) src = rtewpt->notes;
+       ident = global_opts.synthesize_shortnames ?
+                               mkshort(mkshort_handle, src) :
+                               rtewpt->shortname;
+
+       fputs(ident, mps_file);
+       fwrite(zbuf, 1, 1, mps_file);   /* NULL termination to ident */
+
+       if ((mps_ver == 4) || (mps_ver == 5)) {
+               /* unknown */
+               fwrite(zbuf, 4, 1, mps_file);                   /* class */
+               fwrite(zbuf, 1, 1, mps_file);                   /* country - i.e. empty string */
+
+               /* unknown, exactly as for waypoints */
+               fwrite(zbuf, 4, 1, mps_file);
+               fwrite(ffbuf, 12, 1, mps_file);
+               fwrite(zbuf, 2, 1, mps_file);
+               fwrite(ffbuf, 4, 1, mps_file);
+
+               fwrite(zbuf, 1, 1, mps_file);
+               hdr[0] = 3;
+               fwrite(hdr, 1, 1, mps_file);
+               fwrite(zbuf, 17, 1, mps_file);
+       }
+       else {
+               /* unknown, exactly as for waypoints */
+               fwrite(zbuf, 13, 1, mps_file);
+               fwrite(ffbuf, 8, 1, mps_file);
+               fwrite(zbuf, 1, 1, mps_file);
+
+
+               /* unknown */
+               fwrite(zbuf, 1, 1, mps_file);
+               hdr[0] = 3;
+               fwrite(hdr, 1, 1, mps_file);
+               fwrite(zbuf, 16, 1, mps_file);
+       }
+
+       prevRouteWpt = rtewpt;
+
+}
+
+static void
+mps_routedatapoint_w_wrapper(const waypoint *rte)
+{
+       mps_routedatapoint_w(mps_file_out, mps_ver_out, rte);
+}
+
+
+/*
+ * write out to file a route trailer
+ * MRCB
+ */
+static void
+mps_routetrlr_w(FILE *mps_file, int mps_ver, const route_head *rte)
+{
+       char            hdr[2];
+       int                     value = 0;
+
+       hdr[0] = 1;
+
+       if (rte->waypoint_list.next) {          /* this test doesn't do what I want i.e test if this is a valid route - treat as a placeholder for now */
+               fwrite(&value, 4, 1, mps_file);
+               fwrite(hdr, 1, 1, mps_file);
+       }
+}
+       
+static void
+mps_routetrlr_w_wrapper(const route_head *rte)
+{
+       mps_routetrlr_w(mps_file_out, mps_ver_out, rte);
+}
+
+
+/*
+ * read in from file a route record
+ * MRCB
+ */
+static void
+mps_track_r(FILE *mps_file, int mps_ver, route_head **trk)
+{
+       char tbuf[100];
+       char trkname[256];
+       int lat;
+       int lon;
+
+       time_t  dateTime = 0;
+       route_head *track_head;
+       unsigned int trk_count;
+
+       waypoint        *thisWaypoint;
+       double  mps_altitude = unknown_alt;
+       double  mps_depth = unknown_alt;
+
+       mps_readstr(mps_file, trkname, sizeof(trkname));
+       fread(tbuf, 1, 1, mps_file);                            /* display flag */
+       fread(tbuf, 4, 1, mps_file);                            /* colour */
+
+       fread(&trk_count, 4, 1, mps_file);                      /* number of datapoints in tracklog */
+       trk_count = le_read32(&trk_count);
+
+       track_head = route_head_alloc();
+       track_head->rte_name = xstrdup(trkname);
+       route_add_head(track_head);
+       *trk = track_head;
+
+       while (trk_count--) {
+
+               fread(&lat, 4, 1, mps_file); 
+               fread(&lon, 4, 1, mps_file); 
+               lat = le_read32(&lat);
+               lon = le_read32(&lon);
+       
+               fread(tbuf, 1, 1, mps_file);                    /* altitude validity */
+               if (tbuf[0] == 1) {
+                       fread(&mps_altitude,sizeof(mps_altitude),1,mps_file);
+               }
+               else {
+                       mps_altitude = unknown_alt;
+                       fread(tbuf,sizeof(mps_altitude),1, mps_file);
+               }
+
+               fread(tbuf, 1, 1, mps_file);                    /* date/time validity */
+               if (tbuf[0] == 1) {
+                       fread(&dateTime,sizeof(dateTime),1,mps_file);
+               }
+               else {
+                       fread(tbuf,sizeof(dateTime),1, mps_file);
+               }
+
+               fread(tbuf, 1, 1, mps_file);                    /* depth validity */
+               if (tbuf[0] == 1) {
+                       fread(&mps_depth,sizeof(mps_depth),1,mps_file);
+               }
+               else {
+                       mps_depth = unknown_alt;
+                       fread(tbuf,sizeof(mps_depth),1, mps_file);
+               }
+
+               thisWaypoint = xcalloc(sizeof(*thisWaypoint), 1);
+               thisWaypoint->position.latitude.degrees = lat / 2147483648.0 * 180.0;
+               thisWaypoint->position.longitude.degrees = lon / 2147483648.0 * 180.0;
+               thisWaypoint->creation_time = dateTime;
+               thisWaypoint->centiseconds = 0;
+               thisWaypoint->position.altitude.altitude_meters = mps_altitude;
+               route_add_wpt(track_head, thisWaypoint);
+
+       }               /* while (trk_count--) */
+
+       return;
+
+}
+
+/*
+ * write out to file a tracklog header
+ * MRCB
+ */
+static void
+mps_trackhdr_w(FILE *mps_file, int mps_ver, const route_head *trk)
+{
+       unsigned int reclen;
+       unsigned int trk_datapoints;
+       unsigned int colour = 0;                /* unknown colour */
+       int                     tname_len;
+       char            *tname;
+       char            hdr[20];
+       waypoint        *testwpt;
+       time_t          uniqueValue;
+
+       queue *elem, *tmp;
+
+       /* total nodes (waypoints) this track */
+       trk_datapoints = 0;
+       if (trk->waypoint_list.next) {  /* this test doesn't do what I want i.e test if this is a valid track - treat as a placeholder for now */
+               QUEUE_FOR_EACH(&trk->waypoint_list, elem, tmp) {
+                       if (trk_datapoints == 0) {
+                               testwpt = (waypoint *)elem;
+                               uniqueValue = testwpt->creation_time;
+                       }
+                       trk_datapoints++;
+               }
+
+               if (uniqueValue == 0) {
+                       uniqueValue = time(NULL);
+               }
+
+               /* track name */
+               if (!trk->rte_name) {
+                       sprintf(hdr, "Track%04x", uniqueValue);
+                       tname = xstrdup(hdr);
+               }
+               else
+                       tname = xstrdup(trk->rte_name);
+
+               tname_len = strlen(tname);
+               reclen = tname_len + 11;                /* "T" (1) + strlen(tname) + NULL (1) + display flag (1) + colour (4) +
+                                                                               num track datapoints value (4) */
+               
+               reclen += (trk_datapoints * 31) - 1;    /* lat (4) + lon (4) + alt (9) + date (5) + depth (9) ;*/
+                                                                                               /* -1 is because reclen starts from 0 which means a length of 1 */
+               le_write32(&reclen, reclen);
+               fwrite(&reclen, 4, 1, mps_file);
+
+               hdr[0] = 'T';
+               fwrite(hdr, 1, 1, mps_file);
+
+               fwrite(tname, tname_len, 1, mps_file);
+               xfree(tname);
+
+               hdr[0] = 0;
+               hdr[1] = 1;
+               fwrite(hdr, 2, 1, mps_file);    /* NULL string terminator + display flag */
+
+               le_write32(&colour, colour);
+               fwrite(&colour, 4, 1, mps_file);
+
+               le_write32(&trk_datapoints, trk_datapoints);
+               fwrite(&trk_datapoints, 4, 1, mps_file);
+       }
+
+}
+
+static void
+mps_trackhdr_w_wrapper(const route_head *trk)
+{
+       mps_trackhdr_w(mps_file_out, mps_ver_out, trk);
+}
+
+
+/*
+ * write out to file a tracklog datapoint
+ * MRCB
+ */
+static void
+mps_trackdatapoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt)
+{
+       unsigned char hdr[10];
+       int lat = wpt->position.latitude.degrees  / 180.0 * 2147483648.0;
+       int lon = wpt->position.longitude.degrees  / 180.0 * 2147483648.0;
+       time_t  t = wpt->creation_time;
+       char zbuf[10];
+
+       double  mps_altitude = wpt->position.altitude.altitude_meters;
+       double  mps_proximity = unknown_alt;
+       double  mps_depth = unknown_alt;
+
+       memset(zbuf, 0, sizeof(zbuf));
+
+       le_write32(&lat, lat);
+       le_write32(&lon, lon);
+       fwrite(&lat, 4, 1, mps_file);
+       fwrite(&lon, 4, 1, mps_file);
 
        if (mps_altitude == unknown_alt) {
                fwrite(zbuf, 9, 1, mps_file);
@@ -786,8 +1411,13 @@ static void
 mps_read(void)
 {
        waypoint        *wpt;
+       route_head      *rte;
        route_head      *trk;
 
+       char            recType;
+       int                     reclen;
+       int                     skipMe;
+
        mps_ver_in = 0;         /* although initialised at declaration, what happens if there are two mapsource
                                                   input files? */
        mps_fileHeader_r(mps_file_in, &mps_ver_in);
@@ -796,112 +1426,107 @@ mps_read(void)
        printf("static icon_mapping_t icon_table[] = {\n");
 #endif
 
-       while (mps_waypoint_r(mps_file_in, mps_ver_in, &wpt) == ISME) {
-               if (global_opts.objective == wptdata) {
-                       waypt_add(wpt);
-               }
-               else {
-                       xfree(wpt);             /* xcalloc was used */
-               }
-#ifdef DUMP_ICON_TABLE
-               printf("\t{  %4u, \"%s\" },\n", icon, wpt->shortname);
-#endif
-       }
 
-       /* while (mps_route_r(mps_file_in, mps_ver_in, &rte) == ISME) {
-               if (global_opts.objective != rtedata) {
-                       route_free(trk);                        /* rather inefficient to have read it all in just to free it,
-                                                                                  but it's not that bad * /
-               }
-       } */
+       while (!feof(mps_file_in)) {
 
-       while (mps_track_r(mps_file_in, mps_ver_in, &trk) == ISME) {
-               if (global_opts.objective != trkdata) {
-                       route_free(trk);                        /* rather inefficient to have read it all in just to free it,
-                                                                                  but it's not that bad */
-               }
-       }
+               /* skip over this record, unless.... */
+               skipMe = 1;
+               /* Read record length of next section */
+               fread(&reclen, 4, 1, mps_file_in);
+               reclen = le_read32(&reclen);
 
-       if (mps_mapsetname_r(mps_file_in, mps_ver_in) != ISME) {
-               fatal(MYNAME ": Mapsource file not terminated corrected.\n");
-       }
+               /* Read the record type "flag" in - using fread in case in the future need more than one char */
+               fread(&recType, 1, 1, mps_file_in);
 
+               if (recType == 'W')  {
+                       /* Waypoint record */
+                       /* With routes, we need the waypoint info that reveals, for example, the symbol type */
+                       if ((global_opts.objective == wptdata) || (global_opts.objective == rtedata)) {
+                               mps_waypoint_r(mps_file_in, mps_ver_in, &wpt);
 #ifdef DUMP_ICON_TABLE
-               printf("\t{ -1, NULL },\n");
-               printf("};\n");
+                               printf("\t{  %4u, \"%s\" },\n", icon, wpt->shortname);
 #endif
-}
-
-static void
-mps_waypt_pr(const waypoint *wpt)
-{
-       char *src;
-       char *ident;
-       int reclen;
-       char zbuf[25];
-       char ffbuf[25];
-       char display = 1;
-       char icon;
-       int lat = wpt->position.latitude.degrees  / 180.0 * 2147483648.0;
-       int lon = wpt->position.longitude.degrees  / 180.0 * 2147483648.0;
-
-       if(wpt->description) src = wpt->description;
-       if(wpt->notes) src = wpt->notes;
-       ident = global_opts.synthesize_shortnames ?
-                               mkshort(mkshort_handle, src) :
-                               wpt->shortname;
+                               skipMe = 0;
+                       }
+               }
 
-       reclen = 87 + strlen(ident) + strlen(wpt->description);
+               if (recType == 'R')  {
+                       /* Route record */
+                       if (global_opts.objective == rtedata) {
+                               mps_route_r(mps_file_in, mps_ver_in, &rte);
+                               skipMe = 0;
+                       }
+               }
 
-       memset(zbuf, 0, sizeof(zbuf));
-       memset(ffbuf, 0xff, sizeof(ffbuf));
+               if (recType == 'T')  {
+                       /* Track record */
+                       if (global_opts.objective == trkdata) {
+                               mps_track_r(mps_file_in, mps_ver_in, &trk);
+                               skipMe = 0;
+                       }
+               }
 
-       icon = mps_find_icon_number_from_desc(wpt->icon_descr, MAPSOURCE);
+               if (recType == 'V')  {
+                       /* Mapset record */
+                       mps_mapsetname_r(mps_file_in, mps_ver_in);
+                       skipMe = 0;
+                       /* Last record in the file */
+                       break;
+               }
 
-       if (get_cache_icon(wpt) && wpt->icon_descr && (strcmp(wpt->icon_descr, "Geocache Found") != 0)) {
-               icon = mps_find_icon_number_from_desc(get_cache_icon(wpt), MAPSOURCE);
-       }
+               if (skipMe == 1) {
+                       fseek(mps_file_in, reclen, SEEK_CUR); 
+               }
+       }       /* while (!feof(mps_file_in)) */
 
-       le_write32(&reclen, reclen);
-       fwrite(&reclen, 4, 1, mps_file_out);
-       fwrite("W", 1, 1, mps_file_out);
-       fputs(ident, mps_file_out);
-       fwrite(zbuf, 1, 1, mps_file_out);
-       fwrite(zbuf, 9, 1, mps_file_out);
-       fwrite(ffbuf, 12, 1, mps_file_out);
-       fwrite(zbuf, 2, 1, mps_file_out);
-       fwrite(ffbuf, 4, 1, mps_file_out);
+#ifdef DUMP_ICON_TABLE
+       printf("\t{ -1, NULL },\n");
+       printf("};\n");
+#endif
 
-       le_write32(&lat, lat);
-       le_write32(&lon, lon);
-       fwrite(&lat, 4, 1, mps_file_out);
-       fwrite(&lon, 4, 1, mps_file_out);
-
-       fwrite(zbuf, 9, 1, mps_file_out);
-       fputs(wpt->description, mps_file_out);
-       fwrite(zbuf, 10, 1, mps_file_out);
-       fwrite(&display, 1, 1, mps_file_out); /* Show waypoint w/ name */
-       fwrite(zbuf, 7, 1, mps_file_out);
-       fwrite(&icon, 1, 1, mps_file_out);
-       fwrite(zbuf, 23, 1, mps_file_out);
-}
+       return ;
 
-static void 
-mps_noop(const route_head *wp)
-{
-       /* no-op */
 }
 
 void
 mps_write(void)
 {
-       int short_length;
+       int                     short_length;
+       waypoint        *wpt;
+       route_head      *rte;
+       route_head      *trk;
+
+       char            recType;
+       int                     reclen;
+       int                     reclen2;
+       int                     tocopy;
+
+       unsigned char   copybuf[8192];
 
        if (snlen)
                short_length = atoi(snlen);
        else
                short_length = 10;
 
+       if (mpsmergeout) {
+               /* need to skip over the merging header and test merge version */
+               mps_fileHeader_r(mps_file_temp, &mps_ver_temp);
+
+               if (mpsverout) {
+                       if (mps_ver_temp != atoi(mpsverout)) {
+                               fclose(mps_file_temp);
+                               fclose(mps_file_out);
+                               remove(origname);
+                               rename(tempname,origname);
+                               fatal (MYNAME ": merge source version is %d, requested out version is %d\n", mps_ver_temp, atoi(mpsverout));
+                       }
+               }
+               else {
+                       mpsverout = xmalloc(10);
+                       sprintf(mpsverout,"%d", mps_ver_temp);
+               }
+       }
+
        if (mpsverout)
                mps_ver_out = atoi(mpsverout);
        else
@@ -914,20 +1539,151 @@ mps_write(void)
 
        mps_fileHeader_w(mps_file_out, mps_ver_out);
 
+       if ((mpsmergeout) && (global_opts.objective != wptdata)) {
+               while (!feof(mps_file_temp)) {
+
+                       fread(&reclen, 4, 1, mps_file_temp);
+                       reclen2 = le_read32(&reclen);
+
+                       /* Read the record type "flag" in - using fread in case in the future need more than one char */
+                       fread(&recType, 1, 1, mps_file_temp);
+
+                       if (recType == 'W')  {
+                               fwrite(&reclen, 4, 1, mps_file_out);    /* write out untouched */
+                               fwrite(&recType, 1, 1, mps_file_out);
+
+                               for(tocopy = reclen2; tocopy > 0; tocopy -= sizeof(copybuf)) {
+                                       fread(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_temp);
+                                       fwrite(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_out);
+                               }
+                       }
+                       else break;
+               }       /* while (!feof(mps_file_temp)) */
+       }       /* if (mpsmergeout) */
+
        if (global_opts.objective == wptdata) {
+
+               if (mpsmergeout) {
+                       /* since we're processing waypoints, we should read in from whatever version and write out */
+                       /* in the selected version */
+                       while (!feof(mps_file_temp)) {
+
+                               fread(&reclen, 4, 1, mps_file_temp);
+                               reclen2 = le_read32(&reclen);
+
+                               /* Read the record type "flag" in - using fread in case in the future need more than one char */
+                               fread(&recType, 1, 1, mps_file_temp);
+
+                               if (recType == 'W')  {
+                                       mps_waypoint_r(mps_file_temp, mps_ver_temp, &wpt);
+                               }
+                               else break;
+                       }
+               }
                waypt_disp_all(mps_waypoint_w_wrapper);
        }
+
+       if ((mpsmergeout) && (global_opts.objective != rtedata)) {
+               while (!feof(mps_file_temp)) {
+
+                       if (recType == 'R')  {
+                               fwrite(&reclen, 4, 1, mps_file_out);    /* write out untouched */
+                               fwrite(&recType, 1, 1, mps_file_out);
+
+                               for(tocopy = reclen2; tocopy > 0; tocopy -= sizeof(copybuf)) {
+                                       fread(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_temp);
+                                       fwrite(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_out);
+                               }
+                       }
+                       else break;
+                       fread(&reclen, 4, 1, mps_file_temp);
+                       reclen2 = le_read32(&reclen);
+
+                       /* Read the record type "flag" in - using fread in case in the future need more than one char */
+                       fread(&recType, 1, 1, mps_file_temp);
+
+               }       /* while (!feof(mps_file_temp)) */
+       }       /* if (mpsmergeout) */
+
        if (global_opts.objective == rtedata) {
+
+               if (mpsmergeout) {
+                       /* since we're processing routes, we should read in from whatever version and write out */
+                       /* in the selected version */
+                       while (!feof(mps_file_temp)) {
+
+                               if (recType == 'R')  {
+                                       mps_route_r(mps_file_temp, mps_ver_temp, &rte);
+                               }
+                               else break;
+
+                               fread(&reclen, 4, 1, mps_file_temp);
+                               reclen2 = le_read32(&reclen);
+
+                               /* Read the record type "flag" in - using fread in case in the future need more than one char */
+                               fread(&recType, 1, 1, mps_file_temp);
+                       }
+               }
+               /* need to make sure there is a "real" waypoint for each route waypoint */
+               route_disp_all(mps_noop, mps_noop, mps_waypoint_w_wrapper);
+               route_disp_all(mps_routehdr_w_wrapper, mps_routetrlr_w_wrapper, mps_routedatapoint_w_wrapper);
        }
+
+       if ((mpsmergeout) && (global_opts.objective != trkdata)) {
+               while (!feof(mps_file_temp)) {
+
+                       if (recType == 'T')  {
+                               fwrite(&reclen, 4, 1, mps_file_out);    /* write out untouched */
+                               fwrite(&recType, 1, 1, mps_file_out);
+
+                               for(tocopy = reclen2; tocopy > 0; tocopy -= sizeof(copybuf)) {
+                                       fread(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_temp);
+                                       fwrite(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_out);
+                               }
+                       }
+                       else break;
+                       fread(&reclen, 4, 1, mps_file_temp);
+                       reclen2 = le_read32(&reclen);
+
+                       /* Read the record type "flag" in - using fread in case in the future need more than one char */
+                       fread(&recType, 1, 1, mps_file_temp);
+
+               }       /* while (!feof(mps_file_temp)) */
+       }       /* if (mpsmergeout) */
+
        if (global_opts.objective == trkdata) {
+               if (mpsmergeout) {
+                       /* since we're processing tracks, we should read in from whatever version and write out
+                          in the selected version */
+                       while (!feof(mps_file_temp)) {
+
+                               if (recType == 'T')  {
+                                       mps_track_r(mps_file_temp, mps_ver_temp, &trk);
+                               }
+                               else break;
+
+                               fread(&reclen, 4, 1, mps_file_temp);
+                               reclen2 = le_read32(&reclen);
+
+                               /* Read the record type "flag" in - using fread in case in the future need more than one char */
+                               fread(&recType, 1, 1, mps_file_temp);
+                       }
+               }
                route_disp_all(mps_trackhdr_w_wrapper, mps_noop, mps_trackdatapoint_w_wrapper);
        }
 
-       mps_mapsetname_w(mps_file_out, mps_ver_out);
+       if (mpsmergeout) {
+               /* should now be reading a mapset - since we would write out an empty one,
+                  let's use the one from the merge file which may well have decent data in */
+               fwrite(&reclen, 4, 1, mps_file_out);    /* write out untouched */
+               fwrite(&recType, 1, 1, mps_file_out);
 
-       /* fwrite(mps_hdr, sizeof(mps_hdr), 1, mps_file_out);
-       waypt_disp_all(mps_waypt_pr);
-       fwrite(mps_ftr, sizeof(mps_ftr), 1, mps_file_out); */
+               for(tocopy = reclen2; tocopy > 0; tocopy -= sizeof(copybuf)) {
+                       fread(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_temp);
+                       fwrite(copybuf, (tocopy > sizeof(copybuf) ? sizeof(copybuf) : tocopy), 1, mps_file_out);
+               }
+       }
+       else mps_mapsetname_w(mps_file_out, mps_ver_out);
 
        mkshort_del_handle(mkshort_handle);
 
index 2f6ca99ff7f93600304abd2d0399e1c6c2405056..8a003cf60d93b36844fbd73b82d8d4d7fb229c4c 100644 (file)
@@ -99,6 +99,9 @@ int main(
 
        // ===========================
 
+       if (argc < 2) {
+               fatal(MYNAME ": needs a single parameter, the (testo) file to convert\n");
+       }
        pfTestoIn = fopen(argv[1], "rb");
 
        if (pfTestoIn == NULL) {
diff --git a/gpsbabel/reference/psitwpts.txt b/gpsbabel/reference/psitwpts.txt
new file mode 100755 (executable)
index 0000000..27465e7
--- /dev/null
@@ -0,0 +1,17 @@
+  55.205241,  -2.556468,  188.78, 001   , wpt_dot
+  53.618556,  -1.972446,********, 003   , wpt_dot
+  53.451544,  -1.373673,  166.19, 004   , wpt_dot
+  43.621861, -79.378357,   91.21, 005   , wpt_dot
+  49.191132,-123.114769,  -12.37, 006   , wpt_dot
+  49.191140,-123.114736,   -0.11, 007   , wpt_dot
+  51.285499,-116.946531,  769.42, 008   , wpt_dot
+  52.034985,   1.124766,********, BB HOTEL, lodging
+  53.895060,  -2.611549,  134.71, FELL FOOT, parking
+  49.171600,-122.956700,********, FRASERWAY, truck_stop
+  51.094100,-114.010600,********, FRASERWYC, truck_stop
+  46.538170,  12.124091, 1288.04, OLIMPIA, lodging
+  53.900310,  -2.618355,  414.45, PARLICK TO, glider
+  53.859022,  -2.335425,  436.80, PENDLE TO, glider
+  51.047100,-114.081900,********, SANDMANC, lodging
+  49.189300,-123.112200,********, SANDMANV, lodging
+  54.601136,  -3.137685,********, SICKWRNG, shpng_cart
diff --git a/gpsbabel/reference/route/psitrtes.txt b/gpsbabel/reference/route/psitrtes.txt
new file mode 100755 (executable)
index 0000000..96c9fe4
--- /dev/null
@@ -0,0 +1,8 @@
+Route:  RTE 2
+  57.000000,   5.000000,  100.10, Y1    , wpt_dot
+  57.001000,   5.000000,  104.91, Y2    , restrooms
+  57.002000,   5.000000,  109.96, Y3    , wpt_dot
+  57.003000,   5.001000,  115.00, Y4    , wpt_dot
+Route:  X1
+  57.000000,   5.000000,    7.10, X11   , wpt_dot
+  57.001000,   5.000000,   -0.11, X12   , wpt_dot
diff --git a/gpsbabel/reference/track/psittrks.txt b/gpsbabel/reference/track/psittrks.txt
new file mode 100755 (executable)
index 0000000..e9eb75c
--- /dev/null
@@ -0,0 +1,1142 @@
+Track:  ACTIVE LOG001
+  37.004356,  -5.549169,  519.25, 09/05/03 14:34:08, 1
+  37.004528,  -5.548804,  519.73, 09/05/03 14:34:26, 0
+  37.005494,  -5.547044,  516.85, 09/05/03 14:36:15, 0
+  37.005494,  -5.547023,  518.77, 09/05/03 14:38:44, 0
+  37.005494,  -5.547044,  518.77, 09/05/03 14:39:33, 0
+  37.005494,  -5.547044,  518.29, 09/05/03 14:40:33, 0
+  37.005537,  -5.547109,  516.85, 09/05/03 14:40:53, 0
+  37.005558,  -5.547044,  515.88, 09/05/03 14:41:07, 0
+  37.005579,  -5.547023,  516.85, 09/05/03 14:41:24, 0
+  37.005601,  -5.547001,  516.37, 09/05/03 14:41:44, 0
+  37.005601,  -5.547001,  516.85, 09/05/03 14:42:01, 0
+  37.005622,  -5.546980,  517.81, 09/05/03 14:44:20, 0
+  37.005622,  -5.546980,  517.81, 09/05/03 14:45:56, 0
+  37.005601,  -5.546980,  517.33, 09/05/03 14:46:34, 0
+  37.005601,  -5.546980,  517.81, 09/05/03 14:47:52, 0
+  37.005601,  -5.546980,  516.85, 09/05/03 14:50:17, 0
+  37.005601,  -5.546980,  517.33, 09/05/03 14:51:24, 0
+  37.005579,  -5.546980,  518.29, 09/05/03 14:52:13, 0
+  37.005665,  -5.546894,  516.37, 09/05/03 14:52:17, 0
+  37.005730,  -5.546830,  519.25, 09/05/03 14:52:19, 0
+  37.005837,  -5.546851,  522.61, 09/05/03 14:52:22, 0
+  37.005987,  -5.547109,  522.61, 09/05/03 14:52:25, 0
+  37.006116,  -5.547366,  530.30, 09/05/03 14:52:28, 0
+  37.006223,  -5.547516,  534.15, 09/05/03 14:52:31, 0
+  37.006352,  -5.547709,  539.44, 09/05/03 14:52:35, 0
+  37.006395,  -5.547731,  539.44, 09/05/03 14:52:36, 0
+  37.006524,  -5.547817,  537.99, 09/05/03 14:52:39, 0
+  37.006888,  -5.548224,  537.51, 09/05/03 14:52:47, 0
+  37.007360,  -5.548589,  533.19, 09/05/03 14:52:57, 0
+  37.007425,  -5.548632,  533.19, 09/05/03 14:52:58, 0
+  37.007639,  -5.548847,  531.75, 09/05/03 14:53:02, 0
+  37.007811,  -5.548804,  527.90, 09/05/03 14:53:07, 0
+  37.007747,  -5.548718,  526.94, 09/05/03 14:53:09, 0
+  37.007532,  -5.548654,  526.94, 09/05/03 14:53:12, 0
+  37.007275,  -5.548482,  527.42, 09/05/03 14:53:17, 0
+  37.007146,  -5.548418,  532.23, 09/05/03 14:53:20, 0
+  37.007060,  -5.548246,  529.82, 09/05/03 14:53:25, 0
+  37.006910,  -5.548031,  533.67, 09/05/03 14:53:30, 0
+  37.006481,  -5.547774,  537.03, 09/05/03 14:53:36, 0
+  37.006094,  -5.547280,  538.48, 09/05/03 14:53:45, 0
+  37.005987,  -5.547152,  539.44, 09/05/03 14:53:47, 0
+  37.005944,  -5.547001,  544.24, 09/05/03 14:53:50, 0
+  37.006009,  -5.546873,  546.65, 09/05/03 14:53:53, 0
+  37.006180,  -5.546894,  548.57, 09/05/03 14:53:56, 0
+  37.006438,  -5.547130,  551.93, 09/05/03 14:54:00, 0
+  37.006481,  -5.547216,  552.90, 09/05/03 14:54:01, 0
+  37.006717,  -5.547452,  554.82, 09/05/03 14:54:06, 0
+  37.006695,  -5.547216,  555.78, 09/05/03 14:54:11, 0
+  37.006459,  -5.547130,  554.34, 09/05/03 14:54:14, 0
+  37.006202,  -5.546851,  558.18, 09/05/03 14:54:20, 0
+  37.006459,  -5.546851,  557.22, 09/05/03 14:54:25, 0
+  37.006609,  -5.547152,  555.78, 09/05/03 14:54:28, 0
+  37.006738,  -5.547495,  556.74, 09/05/03 14:54:31, 0
+  37.006867,  -5.547667,  559.62, 09/05/03 14:54:33, 0
+  37.007039,  -5.547667,  562.51, 09/05/03 14:54:36, 0
+  37.007017,  -5.547452,  566.35, 09/05/03 14:54:40, 0
+  37.006717,  -5.547473,  567.32, 09/05/03 14:54:43, 0
+  37.006545,  -5.547688,  568.28, 09/05/03 14:54:45, 0
+  37.006502,  -5.548267,  568.76, 09/05/03 14:54:49, 0
+  37.006738,  -5.548460,  567.80, 09/05/03 14:54:55, 0
+  37.006781,  -5.548353,  564.91, 09/05/03 14:54:58, 0
+  37.006695,  -5.548160,  562.51, 09/05/03 14:55:01, 0
+  37.006631,  -5.548117,  562.99, 09/05/03 14:55:02, 0
+  37.006502,  -5.547795,  564.43, 09/05/03 14:55:07, 0
+  37.006159,  -5.547237,  565.39, 09/05/03 14:55:16, 0
+  37.006223,  -5.546873,  567.32, 09/05/03 14:55:24, 0
+  37.006330,  -5.546958,  567.32, 09/05/03 14:55:26, 0
+  37.006438,  -5.547087,  568.76, 09/05/03 14:55:28, 0
+  37.006545,  -5.546894,  571.16, 09/05/03 14:55:35, 0
+  37.006159,  -5.547023,  569.24, 09/05/03 14:55:39, 0
+  37.005966,  -5.547280,  565.87, 09/05/03 14:55:41, 0
+  37.006116,  -5.547709,  568.76, 09/05/03 14:55:46, 0
+  37.006266,  -5.547838,  568.28, 09/05/03 14:55:48, 0
+  37.006459,  -5.547967,  573.08, 09/05/03 14:55:51, 0
+  37.006652,  -5.548117,  575.49, 09/05/03 14:55:54, 0
+  37.006781,  -5.548139,  577.41, 09/05/03 14:55:57, 0
+  37.006760,  -5.547924,  576.93, 09/05/03 14:56:02, 0
+  37.006738,  -5.547774,  575.01, 09/05/03 14:56:07, 0
+  37.006931,  -5.547967,  570.20, 09/05/03 14:56:11, 0
+  37.006974,  -5.548053,  570.68, 09/05/03 14:56:12, 0
+  37.007060,  -5.548224,  570.20, 09/05/03 14:56:14, 0
+  37.007167,  -5.548182,  568.76, 09/05/03 14:56:20, 0
+  37.007124,  -5.548117,  568.76, 09/05/03 14:56:21, 0
+  37.006996,  -5.548031,  564.91, 09/05/03 14:56:23, 0
+  37.006652,  -5.547752,  563.47, 09/05/03 14:56:28, 0
+  37.006524,  -5.547645,  562.51, 09/05/03 14:56:30, 0
+  37.006395,  -5.547366,  560.11, 09/05/03 14:56:34, 0
+  37.006502,  -5.547237,  562.03, 09/05/03 14:56:39, 0
+  37.006609,  -5.547388,  559.14, 09/05/03 14:56:42, 0
+  37.006652,  -5.547624,  559.14, 09/05/03 14:56:44, 0
+  37.006888,  -5.547924,  561.07, 09/05/03 14:56:50, 0
+  37.007146,  -5.547860,  565.87, 09/05/03 14:56:56, 0
+  37.007082,  -5.547645,  571.16, 09/05/03 14:56:59, 0
+  37.007017,  -5.547602,  570.68, 09/05/03 14:57:00, 0
+  37.006910,  -5.547602,  571.16, 09/05/03 14:57:01, 0
+  37.006738,  -5.547345,  572.12, 09/05/03 14:57:07, 0
+  37.006910,  -5.547388,  575.49, 09/05/03 14:57:10, 0
+  37.006974,  -5.547624,  579.33, 09/05/03 14:57:12, 0
+  37.007039,  -5.547795,  582.22, 09/05/03 14:57:14, 0
+  37.007253,  -5.547731,  585.10, 09/05/03 14:57:18, 0
+  37.007232,  -5.547667,  588.46, 09/05/03 14:57:19, 0
+  37.007210,  -5.547602,  592.31, 09/05/03 14:57:20, 0
+  37.007039,  -5.547538,  595.67, 09/05/03 14:57:22, 0
+  37.006674,  -5.547945,  595.19, 09/05/03 14:57:26, 0
+  37.006738,  -5.548182,  594.23, 09/05/03 14:57:28, 0
+  37.006931,  -5.548139,  595.67, 09/05/03 14:57:31, 0
+  37.006910,  -5.548074,  600.48, 09/05/03 14:57:33, 0
+  37.006888,  -5.547924,  605.29, 09/05/03 14:57:36, 0
+  37.006888,  -5.547817,  606.25, 09/05/03 14:57:38, 0
+  37.006738,  -5.547645,  612.02, 09/05/03 14:57:41, 0
+  37.006609,  -5.547667,  615.86, 09/05/03 14:57:42, 0
+  37.006288,  -5.547903,  619.71, 09/05/03 14:57:45, 0
+  37.006180,  -5.548031,  620.19, 09/05/03 14:57:46, 0
+  37.006116,  -5.548160,  620.19, 09/05/03 14:57:47, 0
+  37.006180,  -5.548739,  617.78, 09/05/03 14:57:52, 0
+  37.006309,  -5.548847,  621.15, 09/05/03 14:57:55, 0
+  37.006352,  -5.548868,  621.15, 09/05/03 14:57:56, 0
+  37.006373,  -5.548868,  622.11, 09/05/03 14:57:57, 0
+  37.006652,  -5.548396,  625.96, 09/05/03 14:58:02, 0
+  37.006695,  -5.548160,  633.65, 09/05/03 14:58:05, 0
+  37.006695,  -5.548310,  635.57, 09/05/03 14:58:07, 0
+  37.006738,  -5.548246,  635.57, 09/05/03 14:58:08, 0
+  37.006845,  -5.548010,  641.34, 09/05/03 14:58:12, 0
+  37.006910,  -5.547881,  645.18, 09/05/03 14:58:15, 0
+  37.006953,  -5.547838,  649.99, 09/05/03 14:58:16, 0
+  37.007017,  -5.547752,  655.76, 09/05/03 14:58:18, 0
+  37.007017,  -5.547709,  659.12, 09/05/03 14:58:19, 0
+  37.007017,  -5.547667,  662.01, 09/05/03 14:58:20, 0
+  37.007017,  -5.547602,  665.85, 09/05/03 14:58:21, 0
+  37.007039,  -5.547559,  666.81, 09/05/03 14:58:22, 0
+  37.007060,  -5.547366,  672.10, 09/05/03 14:58:25, 0
+  37.007060,  -5.547323,  674.02, 09/05/03 14:58:26, 0
+  37.007103,  -5.547237,  679.79, 09/05/03 14:58:28, 0
+  37.007124,  -5.547216,  683.63, 09/05/03 14:58:29, 0
+  37.007146,  -5.547194,  687.48, 09/05/03 14:58:30, 0
+  37.007232,  -5.547194,  691.81, 09/05/03 14:58:32, 0
+  37.007318,  -5.547452,  697.09, 09/05/03 14:58:35, 0
+  37.007318,  -5.547709,  701.42, 09/05/03 14:58:37, 0
+  37.007253,  -5.547967,  708.15, 09/05/03 14:58:39, 0
+  37.007232,  -5.548096,  713.44, 09/05/03 14:58:40, 0
+  37.007339,  -5.548289,  717.28, 09/05/03 14:58:44, 0
+  37.007232,  -5.548074,  720.65, 09/05/03 14:58:47, 0
+  37.007146,  -5.548053,  724.49, 09/05/03 14:58:48, 0
+  37.007060,  -5.548031,  728.82, 09/05/03 14:58:49, 0
+  37.006845,  -5.548053,  734.58, 09/05/03 14:58:51, 0
+  37.006609,  -5.548224,  738.43, 09/05/03 14:58:53, 0
+  37.006481,  -5.548482,  741.31, 09/05/03 14:58:55, 0
+  37.006609,  -5.548632,  740.35, 09/05/03 14:58:58, 0
+  37.006609,  -5.548525,  743.24, 09/05/03 14:59:00, 0
+  37.006588,  -5.548482,  748.52, 09/05/03 14:59:01, 0
+  37.006524,  -5.548482,  752.37, 09/05/03 14:59:02, 0
+  37.006438,  -5.548482,  754.77, 09/05/03 14:59:03, 0
+  37.005901,  -5.548761,  761.50, 09/05/03 14:59:08, 0
+  37.005837,  -5.548933,  761.02, 09/05/03 14:59:09, 0
+  37.005880,  -5.549254,  765.35, 09/05/03 14:59:12, 0
+  37.005944,  -5.549405,  769.19, 09/05/03 14:59:14, 0
+  37.006116,  -5.549598,  771.60, 09/05/03 14:59:19, 0
+  37.006288,  -5.549662,  776.40, 09/05/03 14:59:23, 0
+  37.006373,  -5.549662,  779.77, 09/05/03 14:59:25, 0
+  37.006416,  -5.549662,  780.25, 09/05/03 14:59:26, 0
+  37.006567,  -5.549448,  783.13, 09/05/03 14:59:32, 0
+  37.006567,  -5.549383,  784.09, 09/05/03 14:59:33, 0
+  37.006588,  -5.549190,  785.53, 09/05/03 14:59:36, 0
+  37.006588,  -5.549018,  790.82, 09/05/03 14:59:39, 0
+  37.006567,  -5.548868,  794.19, 09/05/03 14:59:41, 0
+  37.006567,  -5.548761,  798.99, 09/05/03 14:59:43, 0
+  37.006545,  -5.548675,  806.20, 09/05/03 14:59:45, 0
+  37.006524,  -5.548611,  809.57, 09/05/03 14:59:46, 0
+  37.006524,  -5.548568,  812.45, 09/05/03 14:59:47, 0
+  37.006524,  -5.548460,  815.34, 09/05/03 14:59:49, 0
+  37.006545,  -5.548353,  817.26, 09/05/03 14:59:51, 0
+  37.006588,  -5.548267,  821.10, 09/05/03 14:59:53, 0
+  37.006609,  -5.548224,  824.47, 09/05/03 14:59:54, 0
+  37.006609,  -5.548224,  826.87, 09/05/03 14:59:55, 0
+  37.006631,  -5.548160,  834.08, 09/05/03 14:59:58, 0
+  37.006524,  -5.548074,  837.93, 09/05/03 15:00:00, 0
+  37.006459,  -5.548031,  839.85, 09/05/03 15:00:01, 0
+  37.005816,  -5.548289,  839.85, 09/05/03 15:00:07, 0
+  37.005751,  -5.548739,  839.37, 09/05/03 15:00:10, 0
+  37.005858,  -5.548890,  842.25, 09/05/03 15:00:12, 0
+  37.005987,  -5.548954,  841.29, 09/05/03 15:00:15, 0
+  37.006116,  -5.548975,  838.41, 09/05/03 15:00:17, 0
+  37.006223,  -5.548954,  847.54, 09/05/03 15:00:20, 0
+  37.006266,  -5.548911,  854.75, 09/05/03 15:00:22, 0
+  37.006330,  -5.548847,  858.11, 09/05/03 15:00:24, 0
+  37.006416,  -5.548761,  861.48, 09/05/03 15:00:27, 0
+  37.006567,  -5.548611,  865.32, 09/05/03 15:00:32, 0
+  37.006631,  -5.548546,  867.25, 09/05/03 15:00:34, 0
+  37.006588,  -5.548460,  869.65, 09/05/03 15:00:36, 0
+  37.006245,  -5.548289,  869.65, 09/05/03 15:00:41, 0
+  37.005622,  -5.548589,  870.61, 09/05/03 15:00:46, 0
+  37.005558,  -5.548761,  870.61, 09/05/03 15:00:47, 0
+  37.005687,  -5.549448,  870.61, 09/05/03 15:00:54, 0
+  37.005794,  -5.549426,  871.57, 09/05/03 15:00:57, 0
+  37.005880,  -5.549362,  869.17, 09/05/03 15:01:00, 0
+  37.006180,  -5.549319,  871.09, 09/05/03 15:01:10, 0
+  37.006266,  -5.549319,  868.21, 09/05/03 15:01:13, 0
+  37.006373,  -5.549276,  864.84, 09/05/03 15:01:16, 0
+  37.006438,  -5.549254,  863.88, 09/05/03 15:01:18, 0
+  37.006459,  -5.549190,  864.36, 09/05/03 15:01:21, 0
+  37.006438,  -5.549018,  863.40, 09/05/03 15:01:25, 0
+  37.006524,  -5.548933,  864.84, 09/05/03 15:01:29, 0
+  37.006803,  -5.549233,  862.92, 09/05/03 15:01:35, 0
+  37.006867,  -5.549769,  861.48, 09/05/03 15:01:39, 0
+  37.006910,  -5.550284,  868.21, 09/05/03 15:01:43, 0
+  37.006996,  -5.550499,  869.65, 09/05/03 15:01:45, 0
+  37.007017,  -5.550606,  873.01, 09/05/03 15:01:46, 0
+  37.007167,  -5.550692,  880.22, 09/05/03 15:01:49, 0
+  37.007210,  -5.550714,  882.63, 09/05/03 15:01:50, 0
+  37.007360,  -5.550649,  884.55, 09/05/03 15:01:53, 0
+  37.007360,  -5.550520,  885.03, 09/05/03 15:01:55, 0
+  37.007382,  -5.550327,  888.88, 09/05/03 15:01:58, 0
+  37.007124,  -5.550199,  885.99, 09/05/03 15:02:01, 0
+  37.006996,  -5.550220,  885.99, 09/05/03 15:02:02, 0
+  37.006631,  -5.550392,  883.11, 09/05/03 15:02:05, 0
+  37.006223,  -5.550950,  877.34, 09/05/03 15:02:09, 0
+  37.006180,  -5.551143,  877.34, 09/05/03 15:02:10, 0
+  37.006330,  -5.551529,  879.74, 09/05/03 15:02:14, 0
+  37.006395,  -5.551572,  880.71, 09/05/03 15:02:16, 0
+  37.006459,  -5.551615,  881.67, 09/05/03 15:02:18, 0
+  37.006524,  -5.551550,  883.11, 09/05/03 15:02:22, 0
+  37.006567,  -5.551422,  880.71, 09/05/03 15:02:25, 0
+  37.006545,  -5.551229,  882.15, 09/05/03 15:02:29, 0
+  37.006545,  -5.551078,  880.22, 09/05/03 15:02:32, 0
+  37.006459,  -5.550756,  877.82, 09/05/03 15:02:39, 0
+  37.006438,  -5.550692,  874.46, 09/05/03 15:02:40, 0
+  37.006438,  -5.550649,  874.94, 09/05/03 15:02:41, 0
+  37.006416,  -5.550606,  873.98, 09/05/03 15:02:42, 0
+  37.006416,  -5.550435,  869.65, 09/05/03 15:02:45, 0
+  37.006416,  -5.550392,  865.80, 09/05/03 15:02:46, 0
+  37.006373,  -5.550177,  864.84, 09/05/03 15:02:51, 0
+  37.006395,  -5.549984,  862.44, 09/05/03 15:02:55, 0
+  37.006373,  -5.549855,  863.40, 09/05/03 15:02:58, 0
+  37.006352,  -5.549748,  863.40, 09/05/03 15:03:00, 0
+  37.006288,  -5.549619,  862.92, 09/05/03 15:03:03, 0
+  37.006266,  -5.549533,  860.52, 09/05/03 15:03:05, 0
+  37.006245,  -5.549426,  857.63, 09/05/03 15:03:08, 0
+  37.006180,  -5.549104,  852.35, 09/05/03 15:03:16, 0
+  37.006180,  -5.549061,  853.31, 09/05/03 15:03:17, 0
+  37.006223,  -5.548890,  849.94, 09/05/03 15:03:22, 0
+  37.006266,  -5.548782,  849.94, 09/05/03 15:03:27, 0
+  37.006288,  -5.548675,  844.66, 09/05/03 15:03:31, 0
+  37.006266,  -5.548589,  843.69, 09/05/03 15:03:33, 0
+  37.006223,  -5.548503,  842.73, 09/05/03 15:03:36, 0
+  37.006266,  -5.548418,  836.00, 09/05/03 15:03:39, 0
+  37.006288,  -5.548396,  836.00, 09/05/03 15:03:40, 0
+  37.006245,  -5.548267,  834.08, 09/05/03 15:03:43, 0
+  37.006223,  -5.548224,  833.12, 09/05/03 15:03:44, 0
+  37.006116,  -5.547988,  827.35, 09/05/03 15:03:48, 0
+  37.006052,  -5.547881,  823.51, 09/05/03 15:03:50, 0
+  37.005987,  -5.547688,  820.14, 09/05/03 15:03:53, 0
+  37.005923,  -5.547516,  816.78, 09/05/03 15:03:56, 0
+  37.005901,  -5.547366,  814.37, 09/05/03 15:03:59, 0
+  37.005858,  -5.547280,  812.93, 09/05/03 15:04:01, 0
+  37.005794,  -5.547087,  807.16, 09/05/03 15:04:05, 0
+  37.005773,  -5.547044,  807.64, 09/05/03 15:04:06, 0
+  37.005708,  -5.546958,  809.09, 09/05/03 15:04:08, 0
+  37.005687,  -5.546851,  804.28, 09/05/03 15:04:10, 0
+  37.005687,  -5.546744,  799.95, 09/05/03 15:04:12, 0
+  37.005665,  -5.546701,  799.95, 09/05/03 15:04:13, 0
+  37.005687,  -5.546443,  797.55, 09/05/03 15:04:19, 0
+  37.005730,  -5.546315,  793.71, 09/05/03 15:04:22, 0
+  37.005858,  -5.546336,  788.42, 09/05/03 15:04:25, 0
+  37.005966,  -5.546443,  783.61, 09/05/03 15:04:27, 0
+  37.005987,  -5.546551,  779.29, 09/05/03 15:04:28, 0
+  37.006052,  -5.546744,  778.32, 09/05/03 15:04:30, 0
+  37.006159,  -5.546894,  773.52, 09/05/03 15:04:32, 0
+  37.006266,  -5.546980,  768.71, 09/05/03 15:04:34, 0
+  37.006395,  -5.547044,  766.31, 09/05/03 15:04:36, 0
+  37.006438,  -5.547044,  765.83, 09/05/03 15:04:37, 0
+  37.006631,  -5.547109,  767.27, 09/05/03 15:04:40, 0
+  37.006717,  -5.547023,  771.60, 09/05/03 15:04:44, 0
+  37.006803,  -5.546787,  771.60, 09/05/03 15:04:51, 0
+  37.006867,  -5.546765,  772.56, 09/05/03 15:04:52, 0
+  37.007082,  -5.546787,  771.60, 09/05/03 15:04:57, 0
+  37.007489,  -5.546658,  770.63, 09/05/03 15:05:05, 0
+  37.007682,  -5.546637,  771.60, 09/05/03 15:05:09, 0
+  37.007918,  -5.546765,  775.92, 09/05/03 15:05:13, 0
+  37.007983,  -5.546808,  776.40, 09/05/03 15:05:14, 0
+  37.008154,  -5.546851,  780.73, 09/05/03 15:05:17, 0
+  37.008262,  -5.546594,  783.61, 09/05/03 15:05:22, 0
+  37.007854,  -5.546486,  779.77, 09/05/03 15:05:26, 0
+  37.007554,  -5.546787,  783.13, 09/05/03 15:05:29, 0
+  37.007468,  -5.547216,  788.90, 09/05/03 15:05:32, 0
+  37.007511,  -5.547409,  792.26, 09/05/03 15:05:34, 0
+  37.007682,  -5.547559,  794.67, 09/05/03 15:05:37, 0
+  37.007811,  -5.547581,  797.55, 09/05/03 15:05:39, 0
+  37.007918,  -5.547538,  801.88, 09/05/03 15:05:42, 0
+  37.007961,  -5.547473,  800.92, 09/05/03 15:05:43, 0
+  37.008026,  -5.547345,  799.95, 09/05/03 15:05:45, 0
+  37.007596,  -5.547237,  799.95, 09/05/03 15:05:50, 0
+  37.007275,  -5.547516,  801.88, 09/05/03 15:05:53, 0
+  37.007146,  -5.548182,  803.32, 09/05/03 15:05:58, 0
+  37.007253,  -5.548353,  803.80, 09/05/03 15:06:00, 0
+  37.007468,  -5.548353,  804.28, 09/05/03 15:06:05, 0
+  37.007575,  -5.547988,  804.28, 09/05/03 15:06:13, 0
+  37.007618,  -5.547903,  799.47, 09/05/03 15:06:15, 0
+  37.007682,  -5.547838,  798.51, 09/05/03 15:06:17, 0
+  37.007768,  -5.547581,  799.95, 09/05/03 15:06:22, 0
+  37.007747,  -5.547409,  803.32, 09/05/03 15:06:24, 0
+  37.007661,  -5.547237,  805.24, 09/05/03 15:06:26, 0
+  37.007489,  -5.547109,  809.57, 09/05/03 15:06:28, 0
+  37.007275,  -5.546851,  820.62, 09/05/03 15:06:32, 0
+  37.007253,  -5.546787,  824.47, 09/05/03 15:06:33, 0
+  37.007318,  -5.546722,  829.27, 09/05/03 15:06:35, 0
+  37.007403,  -5.546722,  832.64, 09/05/03 15:06:37, 0
+  37.007468,  -5.546744,  836.00, 09/05/03 15:06:38, 0
+  37.007554,  -5.546937,  839.37, 09/05/03 15:06:40, 0
+  37.007596,  -5.547323,  843.69, 09/05/03 15:06:43, 0
+  37.007446,  -5.547559,  848.02, 09/05/03 15:06:45, 0
+  37.007232,  -5.547667,  851.87, 09/05/03 15:06:47, 0
+  37.007039,  -5.547624,  855.71, 09/05/03 15:06:49, 0
+  37.006974,  -5.547559,  859.56, 09/05/03 15:06:50, 0
+  37.006953,  -5.547495,  862.92, 09/05/03 15:06:51, 0
+  37.006910,  -5.547431,  866.29, 09/05/03 15:06:52, 0
+  37.006888,  -5.547366,  869.65, 09/05/03 15:06:53, 0
+  37.006867,  -5.547259,  874.46, 09/05/03 15:06:55, 0
+  37.006931,  -5.547194,  875.42, 09/05/03 15:06:57, 0
+  37.007189,  -5.547452,  878.78, 09/05/03 15:07:01, 0
+  37.007253,  -5.547709,  882.15, 09/05/03 15:07:03, 0
+  37.007210,  -5.548010,  885.99, 09/05/03 15:07:05, 0
+  37.007124,  -5.548267,  889.36, 09/05/03 15:07:07, 0
+  37.006953,  -5.548482,  894.16, 09/05/03 15:07:09, 0
+  37.006631,  -5.548482,  898.97, 09/05/03 15:07:12, 0
+  37.006545,  -5.548353,  905.70, 09/05/03 15:07:14, 0
+  37.006545,  -5.548310,  909.06, 09/05/03 15:07:15, 0
+  37.006631,  -5.548267,  913.39, 09/05/03 15:07:17, 0
+  37.006824,  -5.548353,  917.72, 09/05/03 15:07:20, 0
+  37.006931,  -5.548546,  922.04, 09/05/03 15:07:22, 0
+  37.006953,  -5.548825,  927.33, 09/05/03 15:07:24, 0
+  37.006888,  -5.549126,  933.58, 09/05/03 15:07:26, 0
+  37.006824,  -5.549233,  936.46, 09/05/03 15:07:27, 0
+  37.006652,  -5.549426,  944.15, 09/05/03 15:07:29, 0
+  37.006373,  -5.549684,  953.28, 09/05/03 15:07:32, 0
+  37.006137,  -5.549769,  960.01, 09/05/03 15:07:34, 0
+  37.006030,  -5.549705,  963.86, 09/05/03 15:07:35, 0
+  37.005923,  -5.549576,  970.11, 09/05/03 15:07:37, 0
+  37.005858,  -5.549490,  977.32, 09/05/03 15:07:39, 0
+  37.005837,  -5.549426,  982.60, 09/05/03 15:07:40, 0
+  37.005880,  -5.549362,  987.41, 09/05/03 15:07:42, 0
+  37.005987,  -5.549254,  991.74, 09/05/03 15:07:45, 0
+  37.006094,  -5.549276,  995.10, 09/05/03 15:07:47, 0
+  37.006159,  -5.549297,  995.58, 09/05/03 15:07:48, 0
+  37.006395,  -5.549684, 1000.87, 09/05/03 15:07:52, 0
+  37.006416,  -5.549812, 1004.23, 09/05/03 15:07:53, 0
+  37.006438,  -5.549941, 1008.08, 09/05/03 15:07:54, 0
+  37.006438,  -5.550048, 1011.44, 09/05/03 15:07:55, 0
+  37.006438,  -5.550177, 1015.77, 09/05/03 15:07:56, 0
+  37.006416,  -5.550306, 1019.62, 09/05/03 15:07:57, 0
+  37.006245,  -5.550649, 1025.38, 09/05/03 15:08:00, 0
+  37.006030,  -5.550778, 1029.71, 09/05/03 15:08:02, 0
+  37.005837,  -5.550821, 1035.48, 09/05/03 15:08:04, 0
+  37.005644,  -5.550842, 1038.84, 09/05/03 15:08:06, 0
+  37.005451,  -5.550756, 1049.42, 09/05/03 15:08:09, 0
+  37.005386,  -5.550714, 1052.30, 09/05/03 15:08:10, 0
+  37.005386,  -5.550478, 1057.11, 09/05/03 15:08:13, 0
+  37.005429,  -5.550456, 1061.91, 09/05/03 15:08:14, 0
+  37.005537,  -5.550456, 1068.16, 09/05/03 15:08:16, 0
+  37.005687,  -5.550520, 1071.53, 09/05/03 15:08:18, 0
+  37.005816,  -5.550692, 1074.89, 09/05/03 15:08:20, 0
+  37.005880,  -5.550971, 1078.74, 09/05/03 15:08:22, 0
+  37.005901,  -5.551100, 1081.62, 09/05/03 15:08:23, 0
+  37.005880,  -5.551229, 1084.99, 09/05/03 15:08:24, 0
+  37.005858,  -5.551336, 1090.75, 09/05/03 15:08:25, 0
+  37.005773,  -5.551572, 1095.56, 09/05/03 15:08:27, 0
+  37.005622,  -5.551744, 1100.37, 09/05/03 15:08:29, 0
+  37.005451,  -5.551808, 1105.65, 09/05/03 15:08:31, 0
+  37.005365,  -5.551829, 1107.58, 09/05/03 15:08:32, 0
+  37.005086,  -5.551829, 1114.79, 09/05/03 15:08:35, 0
+  37.004850,  -5.551701, 1120.07, 09/05/03 15:08:38, 0
+  37.004850,  -5.551507, 1125.36, 09/05/03 15:08:40, 0
+  37.004914,  -5.551400, 1130.17, 09/05/03 15:08:42, 0
+  37.004957,  -5.551400, 1133.53, 09/05/03 15:08:43, 0
+  37.005043,  -5.551357, 1137.86, 09/05/03 15:08:45, 0
+  37.005365,  -5.551701, 1143.63, 09/05/03 15:08:50, 0
+  37.005365,  -5.551829, 1146.99, 09/05/03 15:08:51, 0
+  37.005343,  -5.552258, 1150.35, 09/05/03 15:08:54, 0
+  37.005236,  -5.552495, 1156.60, 09/05/03 15:08:56, 0
+  37.005064,  -5.552645, 1160.45, 09/05/03 15:08:58, 0
+  37.004807,  -5.552838, 1170.06, 09/05/03 15:09:01, 0
+  37.004721,  -5.552881, 1173.91, 09/05/03 15:09:02, 0
+  37.004442,  -5.552924, 1179.19, 09/05/03 15:09:05, 0
+  37.004249,  -5.552881, 1184.48, 09/05/03 15:09:07, 0
+  37.004120,  -5.552773, 1187.85, 09/05/03 15:09:09, 0
+  37.004013,  -5.552495, 1191.69, 09/05/03 15:09:12, 0
+  37.004035,  -5.552409, 1195.06, 09/05/03 15:09:13, 0
+  37.004099,  -5.552301, 1201.79, 09/05/03 15:09:15, 0
+  37.004185,  -5.552280, 1206.11, 09/05/03 15:09:17, 0
+  37.004378,  -5.552344, 1209.96, 09/05/03 15:09:20, 0
+  37.004592,  -5.552709, 1213.32, 09/05/03 15:09:24, 0
+  37.004635,  -5.553117, 1217.65, 09/05/03 15:09:27, 0
+  37.004592,  -5.553396, 1221.01, 09/05/03 15:09:29, 0
+  37.004249,  -5.553825, 1225.82, 09/05/03 15:09:33, 0
+  37.004035,  -5.553868, 1231.59, 09/05/03 15:09:35, 0
+  37.003863,  -5.553846, 1237.83, 09/05/03 15:09:37, 0
+  37.003734,  -5.553739, 1242.16, 09/05/03 15:09:39, 0
+  37.003670,  -5.553482, 1245.53, 09/05/03 15:09:42, 0
+  37.003734,  -5.553310, 1250.81, 09/05/03 15:09:45, 0
+  37.003777,  -5.553310, 1254.66, 09/05/03 15:09:46, 0
+  37.003820,  -5.553310, 1257.06, 09/05/03 15:09:47, 0
+  37.003927,  -5.553310, 1259.94, 09/05/03 15:09:49, 0
+  37.004120,  -5.553610, 1263.79, 09/05/03 15:09:53, 0
+  37.004142,  -5.553739, 1264.75, 09/05/03 15:09:54, 0
+  37.004142,  -5.554018, 1268.12, 09/05/03 15:09:56, 0
+  37.003992,  -5.554447, 1274.85, 09/05/03 15:09:59, 0
+  37.003820,  -5.554662, 1278.21, 09/05/03 15:10:01, 0
+  37.003648,  -5.554855, 1282.06, 09/05/03 15:10:03, 0
+  37.003155,  -5.554941, 1289.27, 09/05/03 15:10:08, 0
+  37.003069,  -5.554855, 1292.63, 09/05/03 15:10:10, 0
+  37.003026,  -5.554726, 1296.48, 09/05/03 15:10:12, 0
+  37.003069,  -5.554576, 1299.36, 09/05/03 15:10:15, 0
+  37.003262,  -5.554662, 1304.65, 09/05/03 15:10:19, 0
+  37.003369,  -5.554769, 1308.01, 09/05/03 15:10:21, 0
+  37.003520,  -5.555027, 1311.38, 09/05/03 15:10:24, 0
+  37.003584,  -5.555563, 1315.22, 09/05/03 15:10:28, 0
+  37.003584,  -5.555885, 1318.59, 09/05/03 15:10:30, 0
+  37.003498,  -5.556185, 1321.95, 09/05/03 15:10:32, 0
+  37.003455,  -5.556314, 1324.83, 09/05/03 15:10:33, 0
+  37.003348,  -5.556550, 1327.24, 09/05/03 15:10:35, 0
+  37.002983,  -5.556936, 1331.08, 09/05/03 15:10:39, 0
+  37.002897,  -5.556979, 1334.93, 09/05/03 15:10:40, 0
+  37.002833,  -5.557001, 1338.77, 09/05/03 15:10:41, 0
+  37.002683,  -5.557001, 1339.73, 09/05/03 15:10:43, 0
+  37.002361,  -5.556829, 1345.02, 09/05/03 15:10:48, 0
+  37.002275,  -5.556550, 1348.39, 09/05/03 15:10:53, 0
+  37.002361,  -5.556464, 1352.71, 09/05/03 15:10:56, 0
+  37.002468,  -5.556486, 1357.04, 09/05/03 15:10:58, 0
+  37.002640,  -5.556614, 1362.33, 09/05/03 15:11:01, 0
+  37.002811,  -5.556893, 1365.21, 09/05/03 15:11:04, 0
+  37.002876,  -5.557301, 1369.54, 09/05/03 15:11:07, 0
+  37.002833,  -5.557730, 1373.38, 09/05/03 15:11:10, 0
+  37.002790,  -5.557880, 1376.26, 09/05/03 15:11:11, 0
+  37.002704,  -5.558138, 1378.19, 09/05/03 15:11:13, 0
+  37.002296,  -5.558674, 1386.36, 09/05/03 15:11:18, 0
+  37.002103,  -5.558782, 1390.20, 09/05/03 15:11:20, 0
+  37.001803,  -5.558867, 1395.49, 09/05/03 15:11:23, 0
+  37.001653,  -5.558825, 1398.37, 09/05/03 15:11:25, 0
+  37.001588,  -5.558803, 1399.82, 09/05/03 15:11:26, 0
+  37.001438,  -5.558739, 1401.26, 09/05/03 15:11:28, 0
+  37.001395,  -5.558395, 1405.10, 09/05/03 15:11:34, 0
+  37.001503,  -5.558374, 1409.43, 09/05/03 15:11:36, 0
+  37.001674,  -5.558460, 1413.76, 09/05/03 15:11:39, 0
+  37.001803,  -5.558567, 1416.64, 09/05/03 15:11:41, 0
+  37.001932,  -5.558867, 1420.00, 09/05/03 15:11:44, 0
+  37.001975,  -5.559039, 1420.49, 09/05/03 15:11:45, 0
+  37.002039,  -5.559490, 1425.29, 09/05/03 15:11:48, 0
+  37.001932,  -5.560091, 1427.70, 09/05/03 15:11:52, 0
+  37.001717,  -5.560648, 1433.46, 09/05/03 15:11:56, 0
+  37.001653,  -5.560756, 1432.98, 09/05/03 15:11:57, 0
+  37.001503,  -5.561013, 1434.91, 09/05/03 15:11:59, 0
+  37.001202,  -5.561271, 1440.19, 09/05/03 15:12:02, 0
+  37.001009,  -5.561335, 1444.52, 09/05/03 15:12:04, 0
+  37.000816,  -5.561378, 1448.36, 09/05/03 15:12:06, 0
+  37.000558,  -5.561314, 1453.17, 09/05/03 15:12:09, 0
+  37.000473,  -5.560992, 1455.57, 09/05/03 15:12:15, 0
+  37.000515,  -5.560970, 1455.57, 09/05/03 15:12:16, 0
+  37.000580,  -5.560949, 1456.05, 09/05/03 15:12:17, 0
+  37.000666,  -5.560906, 1457.98, 09/05/03 15:12:19, 0
+  37.001052,  -5.561142, 1463.26, 09/05/03 15:12:25, 0
+  37.001224,  -5.561464, 1465.67, 09/05/03 15:12:28, 0
+  37.001288,  -5.561893, 1470.95, 09/05/03 15:12:31, 0
+  37.001288,  -5.562043, 1471.44, 09/05/03 15:12:32, 0
+  37.001202,  -5.562494, 1471.92, 09/05/03 15:12:35, 0
+  37.000880,  -5.563030, 1473.36, 09/05/03 15:12:39, 0
+  37.000558,  -5.563331, 1474.32, 09/05/03 15:12:42, 0
+  37.000129,  -5.563502, 1479.13, 09/05/03 15:12:46, 0
+  36.999850,  -5.563524, 1482.01, 09/05/03 15:12:49, 0
+  36.999464,  -5.563331, 1485.37, 09/05/03 15:12:54, 0
+  36.999443,  -5.563138, 1489.22, 09/05/03 15:12:57, 0
+  36.999464,  -5.563052, 1490.66, 09/05/03 15:12:59, 0
+  36.999764,  -5.563116, 1495.95, 09/05/03 15:13:05, 0
+  36.999829,  -5.563202, 1495.95, 09/05/03 15:13:06, 0
+  37.000000,  -5.563867, 1494.51, 09/05/03 15:13:11, 0
+  36.999915,  -5.564296, 1498.83, 09/05/03 15:13:14, 0
+  36.999850,  -5.564425, 1499.79, 09/05/03 15:13:15, 0
+  36.999722,  -5.564725, 1500.27, 09/05/03 15:13:17, 0
+  36.999335,  -5.565369, 1502.68, 09/05/03 15:13:22, 0
+  36.999056,  -5.565777, 1503.64, 09/05/03 15:13:25, 0
+  36.998627,  -5.566120, 1508.45, 09/05/03 15:13:29, 0
+  36.998498,  -5.566185, 1509.41, 09/05/03 15:13:30, 0
+  36.998112,  -5.566249, 1514.21, 09/05/03 15:13:34, 0
+  36.998048,  -5.566249, 1513.73, 09/05/03 15:13:35, 0
+  36.997790,  -5.565948, 1513.25, 09/05/03 15:13:41, 0
+  36.997812,  -5.565798, 1516.62, 09/05/03 15:13:44, 0
+  36.997855,  -5.565777, 1516.62, 09/05/03 15:13:45, 0
+  36.998026,  -5.565820, 1516.62, 09/05/03 15:13:48, 0
+  36.998155,  -5.565906, 1518.06, 09/05/03 15:13:50, 0
+  36.998413,  -5.566528, 1520.46, 09/05/03 15:13:56, 0
+  36.998413,  -5.567300, 1524.79, 09/05/03 15:14:01, 0
+  36.997919,  -5.568759, 1526.23, 09/05/03 15:14:10, 0
+  36.997683,  -5.569210, 1529.59, 09/05/03 15:14:13, 0
+  36.997511,  -5.569489, 1530.56, 09/05/03 15:14:15, 0
+  36.997297,  -5.569789, 1531.52, 09/05/03 15:14:17, 0
+  36.996717,  -5.570197, 1532.00, 09/05/03 15:14:22, 0
+  36.996353,  -5.570304, 1527.19, 09/05/03 15:14:25, 0
+  36.996117,  -5.570326, 1526.23, 09/05/03 15:14:27, 0
+  36.995687,  -5.570261, 1522.87, 09/05/03 15:14:31, 0
+  36.995215,  -5.570047, 1520.94, 09/05/03 15:14:37, 0
+  36.995087,  -5.569661, 1519.98, 09/05/03 15:14:44, 0
+  36.995387,  -5.569704, 1520.46, 09/05/03 15:14:49, 0
+  36.995559,  -5.569897, 1520.94, 09/05/03 15:14:52, 0
+  36.995752,  -5.570369, 1517.10, 09/05/03 15:14:56, 0
+  36.995795,  -5.570669, 1517.58, 09/05/03 15:14:58, 0
+  36.995773,  -5.571291, 1514.21, 09/05/03 15:15:02, 0
+  36.995709,  -5.571635, 1513.25, 09/05/03 15:15:04, 0
+  36.995430,  -5.572772, 1509.89, 09/05/03 15:15:11, 0
+  36.995409,  -5.572944, 1510.37, 09/05/03 15:15:12, 0
+  36.995108,  -5.573866, 1506.52, 09/05/03 15:15:18, 0
+  36.995044,  -5.574017, 1505.56, 09/05/03 15:15:19, 0
+  36.994829,  -5.574446, 1501.24, 09/05/03 15:15:22, 0
+  36.994550,  -5.574832, 1494.03, 09/05/03 15:15:25, 0
+  36.994314,  -5.575111, 1488.74, 09/05/03 15:15:27, 0
+  36.993928,  -5.575626, 1485.85, 09/05/03 15:15:31, 0
+  36.993692,  -5.575862, 1483.93, 09/05/03 15:15:33, 0
+  36.993327,  -5.576077, 1478.16, 09/05/03 15:15:36, 0
+  36.993070,  -5.576119, 1474.32, 09/05/03 15:15:38, 0
+  36.992812,  -5.576119, 1470.47, 09/05/03 15:15:40, 0
+  36.992705,  -5.576098, 1467.11, 09/05/03 15:15:41, 0
+  36.992598,  -5.576034, 1464.23, 09/05/03 15:15:42, 0
+  36.992447,  -5.575883, 1460.86, 09/05/03 15:15:44, 0
+  36.992383,  -5.575712, 1455.57, 09/05/03 15:15:46, 0
+  36.992362,  -5.575604, 1452.21, 09/05/03 15:15:48, 0
+  36.992404,  -5.575540, 1447.88, 09/05/03 15:15:50, 0
+  36.992555,  -5.575669, 1444.04, 09/05/03 15:15:53, 0
+  36.992619,  -5.575905, 1439.23, 09/05/03 15:15:55, 0
+  36.992598,  -5.576162, 1438.75, 09/05/03 15:15:57, 0
+  36.992512,  -5.576570, 1432.50, 09/05/03 15:16:00, 0
+  36.992469,  -5.576720, 1429.62, 09/05/03 15:16:01, 0
+  36.992426,  -5.576870, 1426.73, 09/05/03 15:16:02, 0
+  36.992426,  -5.577321, 1422.89, 09/05/03 15:16:06, 0
+  36.992555,  -5.577493, 1418.56, 09/05/03 15:16:09, 0
+  36.992598,  -5.577428, 1414.72, 09/05/03 15:16:11, 0
+  36.992447,  -5.577192, 1409.91, 09/05/03 15:16:15, 0
+  36.992254,  -5.577064, 1402.22, 09/05/03 15:16:17, 0
+  36.992147,  -5.577021, 1400.30, 09/05/03 15:16:18, 0
+  36.991932,  -5.576935, 1398.86, 09/05/03 15:16:20, 0
+  36.991396,  -5.576956, 1395.97, 09/05/03 15:16:24, 0
+  36.991267,  -5.577021, 1395.49, 09/05/03 15:16:25, 0
+  36.991031,  -5.577171, 1392.13, 09/05/03 15:16:27, 0
+  36.990817,  -5.577407, 1386.84, 09/05/03 15:16:29, 0
+  36.990666,  -5.577664, 1382.99, 09/05/03 15:16:31, 0
+  36.990581,  -5.577943, 1380.11, 09/05/03 15:16:33, 0
+  36.990538,  -5.578201, 1376.75, 09/05/03 15:16:35, 0
+  36.990538,  -5.578308, 1373.38, 09/05/03 15:16:36, 0
+  36.990581,  -5.578523, 1368.57, 09/05/03 15:16:38, 0
+  36.990731,  -5.578673, 1364.25, 09/05/03 15:16:42, 0
+  36.990774,  -5.578651, 1360.88, 09/05/03 15:16:43, 0
+  36.990817,  -5.578544, 1357.04, 09/05/03 15:16:45, 0
+  36.990752,  -5.578394, 1352.71, 09/05/03 15:16:47, 0
+  36.990602,  -5.578244, 1349.35, 09/05/03 15:16:49, 0
+  36.990237,  -5.578158, 1345.02, 09/05/03 15:16:52, 0
+  36.989980,  -5.578179, 1341.18, 09/05/03 15:16:54, 0
+  36.989701,  -5.578330, 1335.89, 09/05/03 15:16:56, 0
+  36.989594,  -5.578415, 1333.49, 09/05/03 15:16:57, 0
+  36.989121,  -5.578759, 1327.24, 09/05/03 15:17:01, 0
+  36.988885,  -5.578973, 1322.91, 09/05/03 15:17:03, 0
+  36.988671,  -5.579209, 1320.51, 09/05/03 15:17:05, 0
+  36.988456,  -5.579617, 1314.74, 09/05/03 15:17:08, 0
+  36.988413,  -5.579896, 1311.38, 09/05/03 15:17:10, 0
+  36.988413,  -5.580282, 1305.61, 09/05/03 15:17:13, 0
+  36.988478,  -5.580497, 1300.80, 09/05/03 15:17:15, 0
+  36.988628,  -5.580668, 1295.99, 09/05/03 15:17:18, 0
+  36.988735,  -5.580647, 1290.71, 09/05/03 15:17:21, 0
+  36.988778,  -5.580540, 1286.86, 09/05/03 15:17:23, 0
+  36.988714,  -5.580368, 1282.54, 09/05/03 15:17:25, 0
+  36.988585,  -5.580239, 1277.73, 09/05/03 15:17:27, 0
+  36.988370,  -5.580132, 1272.44, 09/05/03 15:17:29, 0
+  36.988156,  -5.580089, 1267.64, 09/05/03 15:17:31, 0
+  36.988027,  -5.580111, 1265.23, 09/05/03 15:17:32, 0
+  36.987770,  -5.580132, 1258.50, 09/05/03 15:17:34, 0
+  36.987641,  -5.580153, 1256.10, 09/05/03 15:17:35, 0
+  36.987276,  -5.580325, 1249.85, 09/05/03 15:17:38, 0
+  36.987169,  -5.580411, 1246.01, 09/05/03 15:17:39, 0
+  36.987062,  -5.580497, 1242.64, 09/05/03 15:17:40, 0
+  36.986761,  -5.580862, 1237.35, 09/05/03 15:17:43, 0
+  36.986482,  -5.581205, 1233.51, 09/05/03 15:17:46, 0
+  36.986396,  -5.581334, 1228.70, 09/05/03 15:17:47, 0
+  36.986139,  -5.581720, 1224.86, 09/05/03 15:17:50, 0
+  36.985903,  -5.582128, 1220.05, 09/05/03 15:17:53, 0
+  36.985817,  -5.582256, 1216.69, 09/05/03 15:17:54, 0
+  36.985581,  -5.582685, 1213.80, 09/05/03 15:17:57, 0
+  36.985409,  -5.582943, 1210.44, 09/05/03 15:17:59, 0
+  36.985173,  -5.583351, 1212.36, 09/05/03 15:18:02, 0
+  36.984572,  -5.583565, 1213.32, 09/05/03 15:18:08, 0
+  36.984422,  -5.583329, 1209.96, 09/05/03 15:18:13, 0
+  36.984551,  -5.583351, 1207.07, 09/05/03 15:18:15, 0
+  36.984680,  -5.583479, 1205.63, 09/05/03 15:18:17, 0
+  36.984766,  -5.583780, 1204.67, 09/05/03 15:18:20, 0
+  36.984830,  -5.584123, 1200.34, 09/05/03 15:18:23, 0
+  36.984851,  -5.584252, 1196.98, 09/05/03 15:18:24, 0
+  36.984959,  -5.584552, 1191.69, 09/05/03 15:18:27, 0
+  36.985044,  -5.584681, 1185.44, 09/05/03 15:18:29, 0
+  36.985109,  -5.584724, 1181.60, 09/05/03 15:18:30, 0
+  36.985173,  -5.584745, 1178.71, 09/05/03 15:18:31, 0
+  36.985259,  -5.584724, 1174.39, 09/05/03 15:18:33, 0
+  36.985259,  -5.584617, 1168.14, 09/05/03 15:18:35, 0
+  36.985173,  -5.584488, 1162.85, 09/05/03 15:18:37, 0
+  36.985087,  -5.584445, 1159.49, 09/05/03 15:18:38, 0
+  36.984894,  -5.584402, 1153.72, 09/05/03 15:18:40, 0
+  36.984658,  -5.584466, 1149.39, 09/05/03 15:18:42, 0
+  36.984529,  -5.584509, 1146.03, 09/05/03 15:18:43, 0
+  36.984444,  -5.584617, 1143.63, 09/05/03 15:18:44, 0
+  36.984122,  -5.584917, 1135.94, 09/05/03 15:18:47, 0
+  36.983800,  -5.585496, 1129.21, 09/05/03 15:18:51, 0
+  36.983457,  -5.586076, 1124.88, 09/05/03 15:18:55, 0
+  36.982770,  -5.587149, 1120.07, 09/05/03 15:19:03, 0
+  36.982276,  -5.587814, 1116.71, 09/05/03 15:19:08, 0
+  36.982105,  -5.588071, 1112.38, 09/05/03 15:19:10, 0
+  36.982019,  -5.588200, 1109.02, 09/05/03 15:19:11, 0
+  36.981912,  -5.588307, 1103.25, 09/05/03 15:19:12, 0
+  36.981697,  -5.588586, 1095.56, 09/05/03 15:19:14, 0
+  36.981504,  -5.588844, 1090.75, 09/05/03 15:19:16, 0
+  36.981418,  -5.588973, 1086.91, 09/05/03 15:19:17, 0
+  36.981204,  -5.589230, 1082.58, 09/05/03 15:19:19, 0
+  36.981032,  -5.589488, 1076.33, 09/05/03 15:19:21, 0
+  36.980839,  -5.589767, 1071.05, 09/05/03 15:19:23, 0
+  36.980731,  -5.589895, 1067.68, 09/05/03 15:19:24, 0
+  36.980560,  -5.590153, 1061.43, 09/05/03 15:19:26, 0
+  36.980453,  -5.590303, 1057.11, 09/05/03 15:19:27, 0
+  36.980281,  -5.590582, 1051.82, 09/05/03 15:19:29, 0
+  36.980088,  -5.590861, 1045.57, 09/05/03 15:19:31, 0
+  36.980002,  -5.591011, 1041.25, 09/05/03 15:19:32, 0
+  36.979916,  -5.591161, 1037.88, 09/05/03 15:19:33, 0
+  36.979744,  -5.591440, 1032.11, 09/05/03 15:19:35, 0
+  36.979637,  -5.591590, 1028.27, 09/05/03 15:19:36, 0
+  36.979551,  -5.591719, 1024.42, 09/05/03 15:19:37, 0
+  36.979380,  -5.591998, 1019.62, 09/05/03 15:19:39, 0
+  36.979272,  -5.592127, 1016.73, 09/05/03 15:19:40, 0
+  36.979187,  -5.592277, 1012.89, 09/05/03 15:19:41, 0
+  36.979079,  -5.592406, 1009.52, 09/05/03 15:19:42, 0
+  36.978993,  -5.592535, 1004.72, 09/05/03 15:19:43, 0
+  36.978779,  -5.592813,  999.91, 09/05/03 15:19:45, 0
+  36.978693,  -5.592942,  995.58, 09/05/03 15:19:46, 0
+  36.978607,  -5.593071,  991.74, 09/05/03 15:19:47, 0
+  36.978521,  -5.593200,  988.85, 09/05/03 15:19:48, 0
+  36.978414,  -5.593328,  984.05, 09/05/03 15:19:49, 0
+  36.978328,  -5.593479,  981.16, 09/05/03 15:19:50, 0
+  36.978242,  -5.593629,  977.32, 09/05/03 15:19:51, 0
+  36.978092,  -5.593886,  972.99, 09/05/03 15:19:53, 0
+  36.977813,  -5.594294,  967.22, 09/05/03 15:19:56, 0
+  36.977706,  -5.594423,  962.42, 09/05/03 15:19:57, 0
+  36.977491,  -5.594659,  955.69, 09/05/03 15:19:59, 0
+  36.977384,  -5.594788,  952.80, 09/05/03 15:20:00, 0
+  36.977277,  -5.594916,  949.44, 09/05/03 15:20:01, 0
+  36.977062,  -5.595152,  946.07, 09/05/03 15:20:03, 0
+  36.976826,  -5.595367,  942.71, 09/05/03 15:20:05, 0
+  36.976719,  -5.595474,  939.83, 09/05/03 15:20:06, 0
+  36.976483,  -5.595646,  934.54, 09/05/03 15:20:08, 0
+  36.976225,  -5.595796,  929.25, 09/05/03 15:20:10, 0
+  36.976097,  -5.595882,  925.89, 09/05/03 15:20:11, 0
+  36.975968,  -5.595946,  922.04, 09/05/03 15:20:12, 0
+  36.975710,  -5.596097,  917.24, 09/05/03 15:20:14, 0
+  36.975474,  -5.596225,  913.39, 09/05/03 15:20:16, 0
+  36.975346,  -5.596290,  909.06, 09/05/03 15:20:17, 0
+  36.975217,  -5.596354,  905.22, 09/05/03 15:20:18, 0
+  36.974981,  -5.596483,  899.93, 09/05/03 15:20:20, 0
+  36.974852,  -5.596547,  897.05, 09/05/03 15:20:21, 0
+  36.974595,  -5.596654,  890.80, 09/05/03 15:20:23, 0
+  36.974359,  -5.596762,  886.95, 09/05/03 15:20:25, 0
+  36.974101,  -5.596890,  878.78, 09/05/03 15:20:27, 0
+  36.973972,  -5.596933,  875.42, 09/05/03 15:20:28, 0
+  36.973844,  -5.596998,  871.09, 09/05/03 15:20:29, 0
+  36.973715,  -5.597041,  868.69, 09/05/03 15:20:30, 0
+  36.973307,  -5.597105,  862.44, 09/05/03 15:20:33, 0
+  36.973178,  -5.597148,  854.75, 09/05/03 15:20:34, 0
+  36.973050,  -5.597169,  851.38, 09/05/03 15:20:35, 0
+  36.972921,  -5.597191,  846.58, 09/05/03 15:20:36, 0
+  36.972771,  -5.597191,  841.77, 09/05/03 15:20:37, 0
+  36.972642,  -5.597212,  836.96, 09/05/03 15:20:38, 0
+  36.972384,  -5.597234,  831.68, 09/05/03 15:20:40, 0
+  36.972234,  -5.597234,  828.31, 09/05/03 15:20:41, 0
+  36.972106,  -5.597255,  823.51, 09/05/03 15:20:42, 0
+  36.971977,  -5.597277,  820.14, 09/05/03 15:20:43, 0
+  36.971698,  -5.597277,  815.34, 09/05/03 15:20:45, 0
+  36.971462,  -5.597277,  810.53, 09/05/03 15:20:47, 0
+  36.971226,  -5.597255,  806.68, 09/05/03 15:20:49, 0
+  36.971097,  -5.597255,  802.36, 09/05/03 15:20:50, 0
+  36.970861,  -5.597234,  798.51, 09/05/03 15:20:52, 0
+  36.970732,  -5.597234,  794.67, 09/05/03 15:20:53, 0
+  36.970625,  -5.597212,  790.82, 09/05/03 15:20:54, 0
+  36.970282,  -5.597126,  781.69, 09/05/03 15:20:57, 0
+  36.970046,  -5.597062,  776.40, 09/05/03 15:20:59, 0
+  36.969831,  -5.596998,  771.11, 09/05/03 15:21:01, 0
+  36.969702,  -5.596955,  767.75, 09/05/03 15:21:02, 0
+  36.969466,  -5.596912,  763.90, 09/05/03 15:21:04, 0
+  36.969230,  -5.596869,  759.10, 09/05/03 15:21:06, 0
+  36.968865,  -5.596805,  752.85, 09/05/03 15:21:09, 0
+  36.968479,  -5.596783,  747.56, 09/05/03 15:21:12, 0
+  36.968222,  -5.596762,  744.20, 09/05/03 15:21:14, 0
+  36.967986,  -5.596740,  741.31, 09/05/03 15:21:16, 0
+  36.967535,  -5.596676,  736.99, 09/05/03 15:21:20, 0
+  36.967320,  -5.596611,  735.07, 09/05/03 15:21:22, 0
+  36.966934,  -5.596504,  731.22, 09/05/03 15:21:26, 0
+  36.966419,  -5.596611,  727.86, 09/05/03 15:21:30, 0
+  36.965969,  -5.597212,  724.01, 09/05/03 15:21:35, 0
+  36.965969,  -5.597491,  720.65, 09/05/03 15:21:37, 0
+  36.966076,  -5.597663,  715.84, 09/05/03 15:21:40, 0
+  36.966140,  -5.597641,  711.99, 09/05/03 15:21:42, 0
+  36.966119,  -5.597491,  707.19, 09/05/03 15:21:45, 0
+  36.966012,  -5.597363,  702.86, 09/05/03 15:21:47, 0
+  36.965840,  -5.597298,  698.53, 09/05/03 15:21:49, 0
+  36.965518,  -5.597191,  695.65, 09/05/03 15:21:52, 0
+  36.965411,  -5.597148,  693.25, 09/05/03 15:21:53, 0
+  36.964316,  -5.597041,  690.36, 09/05/03 15:22:03, 0
+  36.963565,  -5.596762,  694.21, 09/05/03 15:22:11, 0
+  36.963394,  -5.596569,  699.02, 09/05/03 15:22:14, 0
+  36.963372,  -5.596504,  702.38, 09/05/03 15:22:15, 0
+  36.963372,  -5.596461,  705.75, 09/05/03 15:22:16, 0
+  36.963458,  -5.596461,  710.07, 09/05/03 15:22:18, 0
+  36.963501,  -5.596483,  712.95, 09/05/03 15:22:19, 0
+  36.963522,  -5.596547,  715.84, 09/05/03 15:22:20, 0
+  36.963544,  -5.596976,  722.57, 09/05/03 15:22:24, 0
+  36.963265,  -5.597298,  726.41, 09/05/03 15:22:27, 0
+  36.962943,  -5.597320,  729.78, 09/05/03 15:22:30, 0
+  36.962814,  -5.597234,  733.62, 09/05/03 15:22:32, 0
+  36.962771,  -5.597126,  739.39, 09/05/03 15:22:34, 0
+  36.962771,  -5.597105,  742.76, 09/05/03 15:22:35, 0
+  36.962771,  -5.597105,  744.68, 09/05/03 15:22:36, 0
+  36.962965,  -5.597577,  752.37, 09/05/03 15:22:42, 0
+  36.962857,  -5.597856,  755.73, 09/05/03 15:22:44, 0
+  36.962686,  -5.598092,  760.06, 09/05/03 15:22:46, 0
+  36.962342,  -5.598242,  763.90, 09/05/03 15:22:49, 0
+  36.962235,  -5.598242,  763.42, 09/05/03 15:22:50, 0
+  36.962020,  -5.598071,  767.75, 09/05/03 15:22:53, 0
+  36.961999,  -5.597985,  772.08, 09/05/03 15:22:55, 0
+  36.961999,  -5.597942,  777.84, 09/05/03 15:22:57, 0
+  36.962106,  -5.598006,  783.61, 09/05/03 15:23:01, 0
+  36.962256,  -5.598457,  788.90, 09/05/03 15:23:05, 0
+  36.962171,  -5.598736,  792.26, 09/05/03 15:23:07, 0
+  36.961999,  -5.598972,  795.63, 09/05/03 15:23:09, 0
+  36.961677,  -5.599208,  798.99, 09/05/03 15:23:12, 0
+  36.961269,  -5.599122,  801.88, 09/05/03 15:23:16, 0
+  36.961184,  -5.599036,  808.13, 09/05/03 15:23:18, 0
+  36.961205,  -5.598993,  811.97, 09/05/03 15:23:20, 0
+  36.961226,  -5.599015,  814.85, 09/05/03 15:23:21, 0
+  36.961269,  -5.599036,  818.22, 09/05/03 15:23:23, 0
+  36.961377,  -5.599165,  820.14, 09/05/03 15:23:25, 0
+  36.961312,  -5.599744,  823.51, 09/05/03 15:23:29, 0
+  36.961141,  -5.599937,  825.91, 09/05/03 15:23:31, 0
+  36.960819,  -5.600173,  826.87, 09/05/03 15:23:34, 0
+  36.960433,  -5.600066,  829.76, 09/05/03 15:23:38, 0
+  36.960390,  -5.599980,  834.56, 09/05/03 15:23:40, 0
+  36.960411,  -5.599959,  838.89, 09/05/03 15:23:42, 0
+  36.960475,  -5.599959,  843.69, 09/05/03 15:23:45, 0
+  36.960518,  -5.600002,  843.21, 09/05/03 15:23:46, 0
+  36.960626,  -5.600173,  847.06, 09/05/03 15:23:48, 0
+  36.960583,  -5.600624,  850.42, 09/05/03 15:23:51, 0
+  36.960411,  -5.600882,  852.35, 09/05/03 15:23:53, 0
+  36.960089,  -5.601118,  855.23, 09/05/03 15:23:56, 0
+  36.959960,  -5.601139,  854.75, 09/05/03 15:23:57, 0
+  36.959617,  -5.600989,  856.19, 09/05/03 15:24:01, 0
+  36.959574,  -5.600860,  857.63, 09/05/03 15:24:03, 0
+  36.959574,  -5.600817,  862.44, 09/05/03 15:24:05, 0
+  36.959660,  -5.600817,  866.29, 09/05/03 15:24:08, 0
+  36.959724,  -5.601053,  867.73, 09/05/03 15:24:11, 0
+  36.959703,  -5.601311,  873.50, 09/05/03 15:24:13, 0
+  36.959660,  -5.601439,  873.50, 09/05/03 15:24:14, 0
+  36.959231,  -5.602083,  875.90, 09/05/03 15:24:19, 0
+  36.959124,  -5.602148,  876.38, 09/05/03 15:24:20, 0
+  36.959016,  -5.602212,  877.82, 09/05/03 15:24:21, 0
+  36.958780,  -5.602276,  879.26, 09/05/03 15:24:23, 0
+  36.958265,  -5.602212,  882.15, 09/05/03 15:24:28, 0
+  36.958179,  -5.602019,  886.95, 09/05/03 15:24:32, 0
+  36.958308,  -5.602105,  889.84, 09/05/03 15:24:36, 0
+  36.958437,  -5.602641,  892.24, 09/05/03 15:24:41, 0
+  36.958308,  -5.603092,  897.05, 09/05/03 15:24:44, 0
+  36.958115,  -5.603306,  898.01, 09/05/03 15:24:46, 0
+  36.957536,  -5.603499,  898.49, 09/05/03 15:24:51, 0
+  36.957257,  -5.603285,  900.89, 09/05/03 15:24:56, 0
+  36.957386,  -5.603242,  904.26, 09/05/03 15:25:01, 0
+  36.957450,  -5.603371,  905.70, 09/05/03 15:25:03, 0
+  36.957364,  -5.604036,  906.18, 09/05/03 15:25:08, 0
+  36.956871,  -5.604272,  909.06, 09/05/03 15:25:12, 0
+  36.956570,  -5.604208,  912.91, 09/05/03 15:25:15, 0
+  36.956463,  -5.604079,  916.27, 09/05/03 15:25:18, 0
+  36.956463,  -5.603993,  918.20, 09/05/03 15:25:20, 0
+  36.956635,  -5.604315,  921.08, 09/05/03 15:25:25, 0
+  36.956527,  -5.604851,  923.48, 09/05/03 15:25:29, 0
+  36.955969,  -5.605302,  925.89, 09/05/03 15:25:34, 0
+  36.955369,  -5.605195,  928.29, 09/05/03 15:25:40, 0
+  36.955347,  -5.605066,  932.62, 09/05/03 15:25:43, 0
+  36.955411,  -5.605044,  935.98, 09/05/03 15:25:45, 0
+  36.955540,  -5.605259,  939.83, 09/05/03 15:25:49, 0
+  36.955540,  -5.605388,  942.71, 09/05/03 15:25:50, 0
+  36.955411,  -5.606031,  948.00, 09/05/03 15:25:55, 0
+  36.954854,  -5.606461,  948.96, 09/05/03 15:26:00, 0
+  36.954231,  -5.606332,  951.84, 09/05/03 15:26:06, 0
+  36.954124,  -5.606139,  953.28, 09/05/03 15:26:09, 0
+  36.954253,  -5.606182,  955.21, 09/05/03 15:26:14, 0
+  36.954274,  -5.606267,  956.17, 09/05/03 15:26:15, 0
+  36.954081,  -5.606997,  962.42, 09/05/03 15:26:21, 0
+  36.953716,  -5.607169,  966.26, 09/05/03 15:26:24, 0
+  36.953502,  -5.607147,  970.59, 09/05/03 15:26:26, 0
+  36.953266,  -5.606997,  974.91, 09/05/03 15:26:29, 0
+  36.953201,  -5.606782,  978.76, 09/05/03 15:26:33, 0
+  36.953351,  -5.606847,  982.60, 09/05/03 15:26:37, 0
+  36.953394,  -5.606933,  982.60, 09/05/03 15:26:38, 0
+  36.953416,  -5.607405,  987.41, 09/05/03 15:26:42, 0
+  36.953287,  -5.607791,  991.26, 09/05/03 15:26:45, 0
+  36.952794,  -5.608134,  995.58, 09/05/03 15:26:49, 0
+  36.952472,  -5.608091,  998.95, 09/05/03 15:26:52, 0
+  36.952236,  -5.607877, 1002.31, 09/05/03 15:26:56, 0
+  36.952236,  -5.607791, 1003.75, 09/05/03 15:26:58, 0
+  36.952386,  -5.607855, 1007.12, 09/05/03 15:27:02, 0
+  36.952386,  -5.608199, 1011.93, 09/05/03 15:27:05, 0
+  36.952300,  -5.608456, 1015.29, 09/05/03 15:27:07, 0
+  36.952150,  -5.608692, 1018.65, 09/05/03 15:27:09, 0
+  36.951892,  -5.608864, 1022.02, 09/05/03 15:27:11, 0
+  36.951549,  -5.608842, 1024.42, 09/05/03 15:27:14, 0
+  36.951377,  -5.608735, 1026.34, 09/05/03 15:27:16, 0
+  36.951270,  -5.608649, 1028.75, 09/05/03 15:27:18, 0
+  36.951206,  -5.608456, 1030.19, 09/05/03 15:27:21, 0
+  36.951377,  -5.608521, 1033.07, 09/05/03 15:27:25, 0
+  36.951420,  -5.608606, 1033.07, 09/05/03 15:27:26, 0
+  36.951442,  -5.608821, 1035.00, 09/05/03 15:27:28, 0
+  36.951141,  -5.609508, 1040.28, 09/05/03 15:27:33, 0
+  36.950798,  -5.609701, 1045.09, 09/05/03 15:27:36, 0
+  36.950433,  -5.609701, 1046.53, 09/05/03 15:27:39, 0
+  36.950090,  -5.609443, 1047.97, 09/05/03 15:27:44, 0
+  36.950154,  -5.609357, 1050.38, 09/05/03 15:27:48, 0
+  36.950283,  -5.609787, 1048.94, 09/05/03 15:27:53, 0
+  36.950219,  -5.610065, 1052.30, 09/05/03 15:27:55, 0
+  36.950176,  -5.610173, 1052.30, 09/05/03 15:27:56, 0
+  36.949639,  -5.610645, 1052.78, 09/05/03 15:28:01, 0
+  36.949189,  -5.610623, 1055.18, 09/05/03 15:28:05, 0
+  36.948888,  -5.610323, 1057.59, 09/05/03 15:28:10, 0
+  36.948974,  -5.610237, 1058.55, 09/05/03 15:28:14, 0
+  36.949081,  -5.610452, 1057.11, 09/05/03 15:28:17, 0
+  36.949103,  -5.610709, 1056.15, 09/05/03 15:28:19, 0
+  36.949081,  -5.610859, 1053.74, 09/05/03 15:28:20, 0
+  36.949039,  -5.611181, 1051.82, 09/05/03 15:28:22, 0
+  36.948888,  -5.611589, 1056.63, 09/05/03 15:28:25, 0
+  36.948674,  -5.611782, 1060.95, 09/05/03 15:28:27, 0
+  36.948051,  -5.611911, 1060.47, 09/05/03 15:28:32, 0
+  36.947644,  -5.611567, 1062.39, 09/05/03 15:28:38, 0
+  36.947751,  -5.611460, 1063.84, 09/05/03 15:28:43, 0
+  36.947923,  -5.611868, 1062.87, 09/05/03 15:28:48, 0
+  36.947880,  -5.611997, 1062.39, 09/05/03 15:28:49, 0
+  36.947837,  -5.612125, 1063.84, 09/05/03 15:28:50, 0
+  36.947730,  -5.612404, 1063.84, 09/05/03 15:28:52, 0
+  36.947086,  -5.613005, 1064.80, 09/05/03 15:28:58, 0
+  36.946549,  -5.613070, 1066.72, 09/05/03 15:29:02, 0
+  36.946292,  -5.612898, 1068.64, 09/05/03 15:29:05, 0
+  36.946228,  -5.612555, 1070.08, 09/05/03 15:29:11, 0
+  36.946421,  -5.612576, 1068.16, 09/05/03 15:29:16, 0
+  36.946635,  -5.613134, 1066.24, 09/05/03 15:29:23, 0
+  36.946614,  -5.613370, 1067.20, 09/05/03 15:29:25, 0
+  36.946571,  -5.613627, 1069.60, 09/05/03 15:29:27, 0
+  36.945970,  -5.614336, 1073.45, 09/05/03 15:29:33, 0
+  36.945584,  -5.614443, 1076.81, 09/05/03 15:29:36, 0
+  36.945348,  -5.614421, 1078.74, 09/05/03 15:29:38, 0
+  36.944983,  -5.614121, 1082.10, 09/05/03 15:29:43, 0
+  36.944940,  -5.614057, 1082.10, 09/05/03 15:29:44, 0
+  36.945026,  -5.613971, 1084.02, 09/05/03 15:29:49, 0
+  36.945133,  -5.614507, 1084.99, 09/05/03 15:29:55, 0
+  36.945112,  -5.614636, 1085.47, 09/05/03 15:29:56, 0
+  36.945026,  -5.615087, 1084.99, 09/05/03 15:29:59, 0
+  36.944876,  -5.615559, 1092.20, 09/05/03 15:30:02, 0
+  36.944790,  -5.615838, 1095.56, 09/05/03 15:30:04, 0
+  36.944532,  -5.616245, 1102.77, 09/05/03 15:30:07, 0
+  36.944318,  -5.616438, 1106.61, 09/05/03 15:30:09, 0
+  36.943932,  -5.616567, 1109.98, 09/05/03 15:30:12, 0
+  36.943696,  -5.616567, 1113.82, 09/05/03 15:30:14, 0
+  36.943502,  -5.616524, 1117.19, 09/05/03 15:30:16, 0
+  36.943288,  -5.616331, 1121.03, 09/05/03 15:30:20, 0
+  36.943223,  -5.616181, 1124.40, 09/05/03 15:30:23, 0
+  36.943266,  -5.616117, 1127.76, 09/05/03 15:30:26, 0
+  36.943331,  -5.616159, 1129.21, 09/05/03 15:30:28, 0
+  36.943524,  -5.616653, 1132.57, 09/05/03 15:30:34, 0
+  36.943524,  -5.616932, 1136.42, 09/05/03 15:30:36, 0
+  36.943438,  -5.617232, 1140.26, 09/05/03 15:30:38, 0
+  36.943331,  -5.617511, 1144.11, 09/05/03 15:30:40, 0
+  36.943138,  -5.617769, 1147.47, 09/05/03 15:30:42, 0
+  36.942923,  -5.617962, 1150.84, 09/05/03 15:30:44, 0
+  36.942558,  -5.618176, 1155.64, 09/05/03 15:30:47, 0
+  36.942279,  -5.618155, 1158.05, 09/05/03 15:30:49, 0
+  36.942065,  -5.618048, 1159.49, 09/05/03 15:30:51, 0
+  36.941829,  -5.617919, 1166.70, 09/05/03 15:30:54, 0
+  36.941679,  -5.617704, 1171.98, 09/05/03 15:30:58, 0
+  36.941614,  -5.617533, 1176.79, 09/05/03 15:31:01, 0
+  36.941721,  -5.617361, 1177.27, 09/05/03 15:31:10, 0
+  36.941786,  -5.617855, 1180.16, 09/05/03 15:31:15, 0
+  36.941700,  -5.618091, 1183.52, 09/05/03 15:31:17, 0
+  36.941056,  -5.618756, 1184.96, 09/05/03 15:31:23, 0
+  36.940928,  -5.618777, 1184.96, 09/05/03 15:31:24, 0
+  36.940799,  -5.618799, 1186.40, 09/05/03 15:31:25, 0
+  36.940413,  -5.618842, 1188.81, 09/05/03 15:31:28, 0
+  36.939962,  -5.618563, 1193.61, 09/05/03 15:31:33, 0
+  36.939898,  -5.618284, 1197.46, 09/05/03 15:31:37, 0
+  36.940112,  -5.618176, 1195.06, 09/05/03 15:31:44, 0
+  36.940284,  -5.618520, 1198.42, 09/05/03 15:31:49, 0
+  36.940305,  -5.618734, 1200.82, 09/05/03 15:31:51, 0
+  36.940284,  -5.618992, 1205.15, 09/05/03 15:31:53, 0
+  36.940112,  -5.619357, 1206.59, 09/05/03 15:31:56, 0
+  36.939898,  -5.619700, 1209.00, 09/05/03 15:31:59, 0
+  36.939211,  -5.620151, 1213.32, 09/05/03 15:32:05, 0
+  36.938503,  -5.619957, 1217.65, 09/05/03 15:32:12, 0
+  36.938353,  -5.619721, 1222.45, 09/05/03 15:32:15, 0
+  36.938331,  -5.619314, 1224.38, 09/05/03 15:32:22, 0
+  36.938567,  -5.619507, 1226.30, 09/05/03 15:32:28, 0
+  36.938610,  -5.619872, 1230.14, 09/05/03 15:32:31, 0
+  36.938610,  -5.620108, 1233.99, 09/05/03 15:32:33, 0
+  36.938567,  -5.620494, 1237.35, 09/05/03 15:32:36, 0
+  36.938267,  -5.621052, 1240.24, 09/05/03 15:32:40, 0
+  36.938052,  -5.621181, 1241.68, 09/05/03 15:32:42, 0
+  36.937795,  -5.621309, 1243.12, 09/05/03 15:32:44, 0
+  36.937344,  -5.621223, 1242.64, 09/05/03 15:32:48, 0
+  36.937172,  -5.621138, 1243.60, 09/05/03 15:32:50, 0
+  36.937044,  -5.620751, 1243.60, 09/05/03 15:32:56, 0
+  36.937280,  -5.620837, 1243.12, 09/05/03 15:33:03, 0
+  36.937215,  -5.621567, 1245.53, 09/05/03 15:33:09, 0
+  36.936915,  -5.622039, 1248.89, 09/05/03 15:33:13, 0
+  36.936271,  -5.622489, 1248.41, 09/05/03 15:33:19, 0
+  36.935670,  -5.623176, 1243.60, 09/05/03 15:33:26, 0
+  36.935692,  -5.623519, 1240.72, 09/05/03 15:33:29, 0
+  36.935778,  -5.623648, 1245.53, 09/05/03 15:33:32, 0
+  36.935778,  -5.623519, 1248.41, 09/05/03 15:33:36, 0
+  36.935434,  -5.623240, 1248.41, 09/05/03 15:33:41, 0
+  36.934876,  -5.623498, 1250.33, 09/05/03 15:33:46, 0
+  36.934791,  -5.623605, 1250.33, 09/05/03 15:33:47, 0
+  36.934597,  -5.624421, 1250.81, 09/05/03 15:33:53, 0
+  36.934705,  -5.624700, 1253.70, 09/05/03 15:33:56, 0
+  36.934769,  -5.624785, 1258.02, 09/05/03 15:33:58, 0
+  36.934812,  -5.624785, 1258.02, 09/05/03 15:33:59, 0
+  36.934834,  -5.624571, 1260.91, 09/05/03 15:34:04, 0
+  36.934597,  -5.624442, 1264.27, 09/05/03 15:34:07, 0
+  36.934254,  -5.624421, 1268.12, 09/05/03 15:34:10, 0
+  36.933825,  -5.624785, 1271.48, 09/05/03 15:34:14, 0
+  36.933610,  -5.625193, 1273.88, 09/05/03 15:34:17, 0
+  36.933632,  -5.625730, 1274.36, 09/05/03 15:34:21, 0
+  36.933782,  -5.625858, 1279.65, 09/05/03 15:34:24, 0
+  36.933804,  -5.625858, 1284.94, 09/05/03 15:34:25, 0
+  36.933868,  -5.625815, 1288.30, 09/05/03 15:34:27, 0
+  36.933868,  -5.625730, 1291.67, 09/05/03 15:34:29, 0
+  36.933696,  -5.625558, 1295.03, 09/05/03 15:34:32, 0
+  36.933374,  -5.625494, 1299.36, 09/05/03 15:34:35, 0
+  36.933031,  -5.625665, 1302.72, 09/05/03 15:34:38, 0
+  36.932623,  -5.626073, 1307.05, 09/05/03 15:34:42, 0
+  36.932538,  -5.626202, 1307.53, 09/05/03 15:34:43, 0
+  36.932409,  -5.626459, 1308.97, 09/05/03 15:34:45, 0
+  36.932387,  -5.627296, 1311.38, 09/05/03 15:34:51, 0
+  36.932473,  -5.627489, 1316.18, 09/05/03 15:34:53, 0
+  36.932559,  -5.627575, 1319.55, 09/05/03 15:34:55, 0
+  36.932645,  -5.627575, 1323.39, 09/05/03 15:34:57, 0
+  36.932623,  -5.627403, 1327.72, 09/05/03 15:35:00, 0
+  36.932516,  -5.627317, 1330.12, 09/05/03 15:35:02, 0
+  36.932259,  -5.627189, 1332.52, 09/05/03 15:35:05, 0
+  36.931658,  -5.627317, 1337.81, 09/05/03 15:35:10, 0
+  36.931529,  -5.627382, 1337.81, 09/05/03 15:35:11, 0
+  36.931314,  -5.627596, 1340.22, 09/05/03 15:35:13, 0
+  36.931143,  -5.628176, 1342.62, 09/05/03 15:35:17, 0
+  36.931314,  -5.628755, 1346.94, 09/05/03 15:35:22, 0
+  36.931422,  -5.628841, 1350.79, 09/05/03 15:35:24, 0
+  36.931508,  -5.628884, 1354.63, 09/05/03 15:35:26, 0
+  36.931572,  -5.628884, 1359.44, 09/05/03 15:35:28, 0
+  36.931551,  -5.628755, 1360.88, 09/05/03 15:35:31, 0
+  36.931121,  -5.628455, 1360.40, 09/05/03 15:35:36, 0
+  36.930735,  -5.628476, 1366.17, 09/05/03 15:35:39, 0
+  36.930392,  -5.628734, 1368.09, 09/05/03 15:35:42, 0
+  36.930070,  -5.629570, 1370.02, 09/05/03 15:35:48, 0
+  36.930177,  -5.629914, 1373.38, 09/05/03 15:35:51, 0
+  36.930306,  -5.630128, 1377.71, 09/05/03 15:35:54, 0
+  36.930456,  -5.630085, 1380.59, 09/05/03 15:36:00, 0
+  36.930478,  -5.630043, 1380.59, 09/05/03 15:36:01, 0
+  36.930499,  -5.629935, 1382.03, 09/05/03 15:36:03, 0
+  36.930285,  -5.629785, 1385.40, 09/05/03 15:36:06, 0
+  36.929963,  -5.629871, 1389.72, 09/05/03 15:36:09, 0
+  36.929491,  -5.630407, 1392.13, 09/05/03 15:36:14, 0
+  36.929491,  -5.631094, 1395.49, 09/05/03 15:36:19, 0
+  36.929641,  -5.631287, 1398.86, 09/05/03 15:36:22, 0
+  36.929748,  -5.631287, 1403.18, 09/05/03 15:36:24, 0
+  36.929770,  -5.631201, 1406.55, 09/05/03 15:36:26, 0
+  36.929748,  -5.631073, 1411.35, 09/05/03 15:36:28, 0
+  36.929512,  -5.630858, 1414.72, 09/05/03 15:36:32, 0
+  36.929233,  -5.630815, 1419.52, 09/05/03 15:36:35, 0
+  36.928890,  -5.630879, 1422.41, 09/05/03 15:36:38, 0
+  36.928525,  -5.631073, 1425.29, 09/05/03 15:36:41, 0
+  36.928096,  -5.631523, 1430.10, 09/05/03 15:36:45, 0
+  36.927903,  -5.632102, 1432.98, 09/05/03 15:36:49, 0
+  36.927946,  -5.632617, 1437.79, 09/05/03 15:36:53, 0
+  36.928031,  -5.632789, 1439.23, 09/05/03 15:36:55, 0
+  36.928182,  -5.632875, 1443.56, 09/05/03 15:36:58, 0
+  36.928203,  -5.632811, 1446.92, 09/05/03 15:37:00, 0
+  36.928203,  -5.632682, 1451.25, 09/05/03 15:37:02, 0
+  36.928096,  -5.632575, 1456.05, 09/05/03 15:37:04, 0
+  36.927924,  -5.632467, 1459.42, 09/05/03 15:37:06, 0
+  36.927710,  -5.632424, 1463.74, 09/05/03 15:37:08, 0
+  36.927366,  -5.632553, 1466.15, 09/05/03 15:37:11, 0
+  36.926851,  -5.633283, 1468.55, 09/05/03 15:37:17, 0
+  36.926851,  -5.633690, 1472.40, 09/05/03 15:37:20, 0
+  36.927023,  -5.634077, 1476.72, 09/05/03 15:37:24, 0
+  36.927130,  -5.634055, 1480.57, 09/05/03 15:37:27, 0
+  36.927152,  -5.634012, 1483.93, 09/05/03 15:37:28, 0
+  36.927152,  -5.633905, 1487.30, 09/05/03 15:37:30, 0
+  36.926894,  -5.633647, 1491.62, 09/05/03 15:37:34, 0
+  36.926701,  -5.633626, 1495.47, 09/05/03 15:37:36, 0
+  36.926143,  -5.633991, 1495.95, 09/05/03 15:37:41, 0
+  36.925950,  -5.634742, 1496.43, 09/05/03 15:37:46, 0
+  36.926186,  -5.635235, 1500.27, 09/05/03 15:37:51, 0
+  36.926272,  -5.635278, 1504.60, 09/05/03 15:37:53, 0
+  36.926336,  -5.635214, 1508.45, 09/05/03 15:37:55, 0
+  36.926315,  -5.635042, 1512.77, 09/05/03 15:37:58, 0
+  36.926122,  -5.634871, 1516.62, 09/05/03 15:38:01, 0
+  36.925929,  -5.634849, 1519.98, 09/05/03 15:38:03, 0
+  36.925714,  -5.634913, 1521.42, 09/05/03 15:38:05, 0
+  36.925220,  -5.635450, 1520.94, 09/05/03 15:38:10, 0
+  36.925092,  -5.636072, 1517.10, 09/05/03 15:38:14, 0
+  36.925220,  -5.636458, 1515.66, 09/05/03 15:38:17, 0
+  36.925457,  -5.636630, 1519.50, 09/05/03 15:38:21, 0
+  36.925564,  -5.636544, 1523.35, 09/05/03 15:38:24, 0
+  36.925521,  -5.636415, 1526.23, 09/05/03 15:38:26, 0
+  36.925414,  -5.636351, 1530.08, 09/05/03 15:38:28, 0
+  36.925328,  -5.636330, 1530.08, 09/05/03 15:38:29, 0
+  36.925220,  -5.636330, 1530.08, 09/05/03 15:38:30, 0
+  36.924491,  -5.636780, 1528.63, 09/05/03 15:38:37, 0
+  36.924298,  -5.637231, 1525.75, 09/05/03 15:38:40, 0
+  36.924341,  -5.637960, 1529.59, 09/05/03 15:38:45, 0
+  36.924491,  -5.638218, 1531.04, 09/05/03 15:38:48, 0
+  36.924620,  -5.638154, 1533.44, 09/05/03 15:38:53, 0
+  36.924405,  -5.637875, 1533.44, 09/05/03 15:38:58, 0
+  36.924191,  -5.637918, 1533.92, 09/05/03 15:39:00, 0
+  36.923997,  -5.638003, 1534.88, 09/05/03 15:39:02, 0
+  36.923547,  -5.638604, 1533.44, 09/05/03 15:39:07, 0
+  36.923504,  -5.638754, 1533.44, 09/05/03 15:39:08, 0
+  36.923440,  -5.639033, 1537.29, 09/05/03 15:39:10, 0
+  36.923568,  -5.639548, 1536.32, 09/05/03 15:39:15, 0
+  36.923761,  -5.639527, 1535.36, 09/05/03 15:39:21, 0
+  36.923504,  -5.639226, 1535.36, 09/05/03 15:39:26, 0
+  36.923332,  -5.639184, 1534.88, 09/05/03 15:39:28, 0
+  36.923118,  -5.639119, 1534.88, 09/05/03 15:39:30, 0
+  36.922946,  -5.639119, 1535.36, 09/05/03 15:39:32, 0
+  36.922517,  -5.639205, 1535.36, 09/05/03 15:39:36, 0
+  36.921766,  -5.639827, 1536.32, 09/05/03 15:39:43, 0
+  36.921508,  -5.640771, 1537.29, 09/05/03 15:39:49, 0
+  36.921744,  -5.641501, 1536.32, 09/05/03 15:39:55, 0
+  36.921873,  -5.641565, 1534.88, 09/05/03 15:39:57, 0
+  36.921959,  -5.641479, 1532.00, 09/05/03 15:40:00, 0
+  36.921916,  -5.641308, 1528.63, 09/05/03 15:40:03, 0
+  36.921873,  -5.641243, 1528.63, 09/05/03 15:40:04, 0
+  36.921594,  -5.641050, 1525.27, 09/05/03 15:40:08, 0
+  36.921380,  -5.641072, 1520.94, 09/05/03 15:40:10, 0
+  36.921251,  -5.641115, 1521.42, 09/05/03 15:40:11, 0
+  36.920929,  -5.641351, 1524.31, 09/05/03 15:40:14, 0
+  36.920822,  -5.641458, 1525.27, 09/05/03 15:40:15, 0
+  36.920457,  -5.642488, 1525.27, 09/05/03 15:40:22, 0
+  36.920714,  -5.643089, 1525.27, 09/05/03 15:40:28, 0
+  36.920972,  -5.643046, 1524.31, 09/05/03 15:40:34, 0
+  36.920886,  -5.642831, 1520.94, 09/05/03 15:40:38, 0
+  36.920414,  -5.642745, 1517.58, 09/05/03 15:40:43, 0
+  36.920178,  -5.642831, 1516.62, 09/05/03 15:40:45, 0
+  36.919556,  -5.643454, 1517.58, 09/05/03 15:40:51, 0
+  36.919427,  -5.643926, 1515.18, 09/05/03 15:40:54, 0
+  36.919513,  -5.644805, 1514.21, 09/05/03 15:41:00, 0
+  36.919770,  -5.645106, 1513.73, 09/05/03 15:41:05, 0
+  36.919920,  -5.644977, 1511.33, 09/05/03 15:41:10, 0
+  36.919577,  -5.644698, 1510.37, 09/05/03 15:41:16, 0
+  36.919384,  -5.644698, 1510.85, 09/05/03 15:41:18, 0
+  36.919041,  -5.644741, 1507.48, 09/05/03 15:41:21, 0
+  36.918590,  -5.645041, 1504.12, 09/05/03 15:41:25, 0
+  36.917646,  -5.646007, 1500.76, 09/05/03 15:41:34, 0
+  36.917324,  -5.646393, 1496.43, 09/05/03 15:41:37, 0
+  36.916251,  -5.647917, 1492.58, 09/05/03 15:41:48, 0
+  36.915586,  -5.649312, 1489.22, 09/05/03 15:41:57, 0
+  36.915500,  -5.649655, 1488.26, 09/05/03 15:41:59, 0
+  36.915565,  -5.650342, 1486.82, 09/05/03 15:42:04, 0
+  36.915629,  -5.650535, 1486.82, 09/05/03 15:42:06, 0
+  36.915779,  -5.650706, 1482.49, 09/05/03 15:42:10, 0
+  36.915822,  -5.650706, 1478.65, 09/05/03 15:42:12, 0
+  36.915886,  -5.650642, 1473.36, 09/05/03 15:42:14, 0
+  36.915908,  -5.650599, 1469.99, 09/05/03 15:42:15, 0
+  36.915929,  -5.650449, 1466.15, 09/05/03 15:42:18, 0
+  36.915801,  -5.650213, 1463.26, 09/05/03 15:42:22, 0
+  36.915693,  -5.650084, 1462.30, 09/05/03 15:42:24, 0
+  36.915479,  -5.649977, 1466.15, 09/05/03 15:42:27, 0
+  36.915414,  -5.649977, 1466.15, 09/05/03 15:42:28, 0
+  36.915350,  -5.649955, 1466.15, 09/05/03 15:42:29, 0
+  36.915157,  -5.649912, 1463.74, 09/05/03 15:42:31, 0
+  36.914492,  -5.649977, 1460.38, 09/05/03 15:42:37, 0
+  36.913998,  -5.650213, 1455.09, 09/05/03 15:42:41, 0
+  36.913869,  -5.650277, 1454.61, 09/05/03 15:42:42, 0
+  36.913655,  -5.650492, 1453.65, 09/05/03 15:42:44, 0
+  36.913440,  -5.650771, 1449.32, 09/05/03 15:42:46, 0
+  36.913269,  -5.651050, 1445.00, 09/05/03 15:42:48, 0
+  36.913140,  -5.651350, 1441.15, 09/05/03 15:42:50, 0
+  36.913033,  -5.651672, 1438.27, 09/05/03 15:42:52, 0
+  36.912990,  -5.651844, 1438.27, 09/05/03 15:42:53, 0
+  36.912947,  -5.652316, 1434.42, 09/05/03 15:42:56, 0
+  36.913033,  -5.652659, 1429.14, 09/05/03 15:42:59, 0
+  36.913118,  -5.652831, 1426.25, 09/05/03 15:43:01, 0
+  36.913226,  -5.652895, 1422.89, 09/05/03 15:43:04, 0
+  36.913247,  -5.652766, 1418.56, 09/05/03 15:43:08, 0
+  36.913161,  -5.652659, 1412.79, 09/05/03 15:43:10, 0
+  36.913011,  -5.652595, 1409.91, 09/05/03 15:43:12, 0
+  36.912689,  -5.652595, 1407.03, 09/05/03 15:43:15, 0
+  36.912453,  -5.652702, 1403.66, 09/05/03 15:43:17, 0
+  36.912217,  -5.652874, 1403.18, 09/05/03 15:43:19, 0
+  36.911874,  -5.653152, 1398.86, 09/05/03 15:43:22, 0
+  36.911445,  -5.653603, 1394.53, 09/05/03 15:43:26, 0
+  36.911209,  -5.653839, 1390.20, 09/05/03 15:43:28, 0
+  36.910973,  -5.654075, 1389.24, 09/05/03 15:43:30, 0
+  36.910651,  -5.654418, 1383.96, 09/05/03 15:43:33, 0
+  36.910393,  -5.654676, 1379.15, 09/05/03 15:43:35, 0
+  36.910050,  -5.654998, 1376.26, 09/05/03 15:43:38, 0
+  36.909814,  -5.655212, 1371.46, 09/05/03 15:43:40, 0
+  36.909556,  -5.655427, 1367.61, 09/05/03 15:43:42, 0
+  36.909320,  -5.655642, 1364.73, 09/05/03 15:43:44, 0
+  36.908956,  -5.655985, 1358.48, 09/05/03 15:43:47, 0
+  36.908698,  -5.656221, 1353.67, 09/05/03 15:43:49, 0
+  36.908441,  -5.656457, 1350.31, 09/05/03 15:43:51, 0
+  36.908290,  -5.656672, 1345.50, 09/05/03 15:43:53, 0
+  36.907904,  -5.657015, 1338.29, 09/05/03 15:43:56, 0
+  36.907775,  -5.657144, 1338.77, 09/05/03 15:43:57, 0
+  36.907496,  -5.657444, 1334.45, 09/05/03 15:44:00, 0
+  36.907411,  -5.657573, 1334.45, 09/05/03 15:44:01, 0
+  36.907303,  -5.657680, 1329.64, 09/05/03 15:44:02, 0
+  36.907003,  -5.658002, 1325.80, 09/05/03 15:44:05, 0
+  36.906788,  -5.658216, 1321.95, 09/05/03 15:44:07, 0
+  36.906703,  -5.658324, 1318.10, 09/05/03 15:44:08, 0
+  36.906595,  -5.658431, 1316.18, 09/05/03 15:44:09, 0
+  36.906359,  -5.658753, 1309.93, 09/05/03 15:44:12, 0
+  36.906188,  -5.658967, 1304.65, 09/05/03 15:44:14, 0
+  36.906123,  -5.659075, 1299.36, 09/05/03 15:44:15, 0
+  36.905930,  -5.659289, 1297.92, 09/05/03 15:44:17, 0
+  36.905673,  -5.659482, 1294.07, 09/05/03 15:44:19, 0
+  36.905437,  -5.659697, 1289.75, 09/05/03 15:44:21, 0
+  36.905308,  -5.659804, 1287.82, 09/05/03 15:44:22, 0
+  36.905286,  -5.659826, 1296.48, 09/05/03 16:39:44, 1
+  36.905286,  -5.659826,  188.56, 09/05/03 16:39:45, 0
+  36.905286,  -5.659826,  188.08, 09/05/03 16:39:47, 0
+  36.761112,  -5.836186,  189.52, 09/05/03 16:39:56, 1
+  36.761112,  -5.836186,  186.15, 09/05/03 16:40:01, 0
+  36.761112,  -5.836208,  182.79, 09/05/03 16:40:04, 0
+  36.761112,  -5.836186,  179.42, 09/05/03 16:40:07, 0
+  36.761112,  -5.836186,  176.54, 09/05/03 16:40:11, 0
+  36.761112,  -5.836186,  174.14, 09/05/03 16:40:15, 0
+  36.761112,  -5.836165,  170.77, 09/05/03 16:40:21, 0
+  36.761112,  -5.836165,  168.37, 09/05/03 16:40:26, 0
+  36.761112,  -5.836165,  164.52, 09/05/03 16:40:37, 0
+  36.761112,  -5.836165,  160.68, 09/05/03 16:40:59, 0
+  36.761112,  -5.836186,  159.72, 09/05/03 16:42:18, 0
+  36.761091,  -5.836165,  161.16, 09/05/03 16:44:12, 0
index 19dfcefc3494e4b3d43c4d979c38561983cbeddc..9bb209a40e95ee24b36c9dd1c21f24275f50d7e5 100755 (executable)
@@ -222,6 +222,7 @@ ${PNAME} -i mapsource -f reference/mapsource.mps  -o gpx -F ${TMPDIR}/ms1.gpx
 ${PNAME} -i mapsource -f reference/mapsource.mps  -o mapsource -F ${TMPDIR}/ms.mps
 ${PNAME} -i mapsource -f ${TMPDIR}/ms.mps -o gpx -F ${TMPDIR}/ms2.gpx
 compare ${TMPDIR}/ms1.gpx ${TMPDIR}/ms2.gpx
+
 #
 # MRCB mapsource track test
 #
@@ -230,6 +231,26 @@ ${PNAME} -t -i mapsource -f reference/track/mps-track.mps -o mapsource \
          -F ${TMPDIR}/mps-track.mps
 compare ${TMPDIR}/mps-track.mps reference/track/
 
+# Now do a test of reading waypoints from a track-only file - should have an empty result
+rm -f ${TMPDIR}/mps-track.mps
+${PNAME} -i mapsource -f reference/track/mps-track.mps -o mapsource \
+         -F ${TMPDIR}/mps-track.mps
+compare ${TMPDIR}/mps-track.mps reference/mps-empty.mps
+
+#
+# MRCB mapsource route test
+#
+rm -f ${TMPDIR}/mps-route.mps
+${PNAME} -r -i mapsource -f reference/route/route.mps -o mapsource,mpsverout=4 \
+         -F ${TMPDIR}/mps-route.mps
+compare ${TMPDIR}/mps-route.mps reference/route/route.mps
+
+# Now do a test of reading tracks from a route-only file - should have an empty result
+rm -f ${TMPDIR}/mps-route.mps
+${PNAME} -t -i mapsource -f reference/route/route.mps -o mapsource \
+         -F ${TMPDIR}/mps-route.mps
+compare ${TMPDIR}/mps-route.mps reference/mps-empty.mps
+
 #
 # Geocaching Database is a binary Palm format that, like the GPX variants
 # has a zillion "equivalent" encodings of any given record set.  So we
@@ -341,6 +362,45 @@ ${PNAME} -i navicache -f reference/navicache.xml -o gpsutil -F ${TMPDIR}/navi.wp
 compare ${TMPDIR}/navi.wpt reference/navicache.ref
 #
 
+# PsiTrex.  A text format that can't be handled by XCSV due to context of
+# data based on other data values in the file
+# Waypoints first
+rm -f ${TMPDIR}/psit-ww.txt ${TMPDIR}/psit-ww.mps
+${PNAME} -i psitrex -f reference/psitwpts.txt -o mapsource -F ${TMPDIR}/psit-ww.mps
+${PNAME} -i mapsource -f ${TMPDIR}/psit-ww.mps -o psitrex -F ${TMPDIR}/psit-ww.txt
+compare reference/psitwpts.txt ${TMPDIR}/psit-ww.txt
+
+# Now test correct "empty" handling - ask for routes when there aren't any
+# Uses mapsource as the empty handling for this has already happened above
+rm -f ${TMPDIR}/psit-wr.mps
+${PNAME} -r -i psitrex -f reference/psitwpts.txt -o mapsource -F ${TMPDIR}/psit-wr.mps
+compare reference/mps-empty.mps ${TMPDIR}/psit-wr.mps
+
+# Routes next
+rm -f ${TMPDIR}/psit-rr.txt ${TMPDIR}/psit-rr.mps
+${PNAME} -r -i psitrex -f reference/route/psitrtes.txt -o mapsource -F ${TMPDIR}/psit-rr.mps
+${PNAME} -r -i mapsource -f ${TMPDIR}/psit-rr.mps -o psitrex -F ${TMPDIR}/psit-rr.txt
+compare reference/route/psitrtes.txt ${TMPDIR}/psit-rr.txt
+
+# Now test correct "empty" handling - ask for tracks when there aren't any
+# Uses mapsource as the empty handling for this has already happened above
+rm -f ${TMPDIR}/psit-rt.mps
+${PNAME} -t -i psitrex -f reference/route/psitrtes.txt -o mapsource -F ${TMPDIR}/psit-rt.mps
+compare reference/mps-empty.mps ${TMPDIR}/psit-rt.mps
+
+# Tracks last
+rm -f ${TMPDIR}/psit-tt.txt ${TMPDIR}/psit-tt.mps
+${PNAME} -t -i psitrex -f reference/track/psittrks.txt -o mapsource -F ${TMPDIR}/psit-tt.mps
+${PNAME} -t -i mapsource -f ${TMPDIR}/psit-tt.mps -o psitrex -F ${TMPDIR}/psit-tt.txt
+echo skipping psitrex track test for now
+# compare reference/track/psittrks.txt ${TMPDIR}/psit-tt.txt
+
+# Now test correct "empty" handling - ask for waypoints when there aren't any
+# Uses mapsource as the empty handling for this has already happened above
+rm -f ${TMPDIR}/psit-tw.mps
+${PNAME} -i psitrex -f reference/track/psittrks.txt -o mapsource -F ${TMPDIR}/psit-tw.mps
+compare reference/mps-empty.mps ${TMPDIR}/psit-tw.mps
+
 #
 # Arc Distance filter
 #
index 602bec15c383a4b3a7bbaab5f61eaa0949d5d12d..7de8df7d28aedcda6041a9b39ef9222282b3c9aa 100644 (file)
@@ -54,6 +54,7 @@ extern ff_vecs_t quovadis_vecs;
 extern ff_vecs_t gpilots_vecs;
 extern ff_vecs_t saroute_vecs;
 extern ff_vecs_t navicache_vecs;
+extern ff_vecs_t psit_vecs;             /* MRCB */
 
 static
 vecs_t vec_list[] = {
@@ -202,6 +203,12 @@ vecs_t vec_list[] = {
                "Navicache.com XML",
                NULL
        },
+       {       /* MRCB */
+               &psit_vecs,
+               "psitrex",
+               "KuDaTa PsiTrex text",
+               NULL
+       },
        {
                NULL,
                NULL,